summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index b556f18b76..c6af2edee5 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -8702,6 +8702,14 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init,
CheckVariableDeclarationType(VDecl);
if (VDecl->isInvalidDecl())
return;
+
+ // If all looks well, warn if this is a case that will change meaning when
+ // we implement N3922.
+ if (DirectInit && !CXXDirectInit && isa<InitListExpr>(Init)) {
+ Diag(Init->getLocStart(),
+ diag::warn_auto_var_direct_list_init)
+ << FixItHint::CreateInsertion(Init->getLocStart(), "=");
+ }
}
// dllimport cannot be used on variable definitions.