aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
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.