start converting Sema over to using its canonical Diag method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59561 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 5ad1429..98f4c01 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -714,14 +714,12 @@
// destination type.
// FIXME: We're pretending to do copy elision here; return to
// this when we have ASTs for such things.
- if (PerformImplicitConversion(Init, DeclType))
- return Diag(InitLoc,
- diag::err_typecheck_convert_incompatible,
- DeclType.getAsString(), InitEntity,
- "initializing",
- Init->getSourceRange());
- else
+ if (!PerformImplicitConversion(Init, DeclType))
return false;
+
+ return Diag(InitLoc, diag::err_typecheck_convert_incompatible)
+ << DeclType.getAsString() << InitEntity << "initializing"
+ << Init->getSourceRange();
}
// C99 6.7.8p16.