diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-02-14 12:18:48 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-02-14 12:18:48 +0000 |
commit | ec12bbe359799efc32df6bde5e872cb2713c0b19 (patch) | |
tree | dfd4e4f0fa9ce6e010e098662d5f00a37c9ff0e3 /lib/Sema/SemaDecl.cpp | |
parent | 9e435806aaf5bd7e974d317ef247f200200ad686 (diff) |
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index b556f18b7632b..c6af2edee512c 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. |