From 42acd4a05b523f53e6708cdbb77a4a10c352a03c Mon Sep 17 00:00:00 2001 From: Sebastian Redl Date: Tue, 17 Jan 2012 22:50:08 +0000 Subject: Auto deduction support for std::initializer_list, including for-range support. This means you can now write: for (int i : {1, 4, 512, 23, 251}) {} llvm-svn: 148353 --- clang/lib/Sema/SemaDecl.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'clang/lib/Sema/SemaDecl.cpp') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 0e99f704768..61e104fd1d2 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -5976,9 +5976,7 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, if (TypeMayContainAuto && VDecl->getType()->getContainedAutoType()) { TypeSourceInfo *DeducedType = 0; if (!DeduceAutoType(VDecl->getTypeSourceInfo(), Init, DeducedType)) - Diag(VDecl->getLocation(), diag::err_auto_var_deduction_failure) - << VDecl->getDeclName() << VDecl->getType() << Init->getType() - << Init->getSourceRange(); + DiagnoseAutoDeductionFailure(VDecl, Init); if (!DeducedType) { RealDecl->setInvalidDecl(); return; -- cgit v1.2.3