summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2012-01-17 22:50:08 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2012-01-17 22:50:08 +0000
commit42acd4a05b523f53e6708cdbb77a4a10c352a03c (patch)
tree2b5a67e45c5e5cdcd2e3cc049c3841f5407bcb4c /clang/lib/Sema/SemaDecl.cpp
parent43144e72b5197c2e17a5586a59d41afe177d5055 (diff)
downloadbcm5719-llvm-42acd4a05b523f53e6708cdbb77a4a10c352a03c.tar.gz
bcm5719-llvm-42acd4a05b523f53e6708cdbb77a4a10c352a03c.zip
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
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp4
1 files changed, 1 insertions, 3 deletions
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;
OpenPOWER on IntegriCloud