aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-18 22:52:51 +0000
committerChris Lattner <sabre@nondot.org>2008-11-18 22:52:51 +0000
commitc9c7c4e06bba5dce053162ea1ead5743d7bba35b (patch)
treebd1668aa18766c795d495b40f4fcd6717515f3b0 /lib/Sema/SemaDecl.cpp
parent3e283e344595e0bd499b13b30a92b7d9c10a2140 (diff)
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
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 5ad1429c35..98f4c01e5e 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -714,14 +714,12 @@ bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType,
// 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.