summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-02-14 12:18:48 +0000
committerdim <dim@FreeBSD.org>2015-02-14 12:18:48 +0000
commitff28d95d1f024411955913aaa68c17f2b09c46fd (patch)
treedfd4e4f0fa9ce6e010e098662d5f00a37c9ff0e3 /lib/Sema/SemaDecl.cpp
parentcf8e1ca250cdf4ade1e7d628e56040eb27797b5d (diff)
downloadFreeBSD-src-ff28d95d1f024411955913aaa68c17f2b09c46fd.zip
FreeBSD-src-ff28d95d1f024411955913aaa68c17f2b09c46fd.tar.gz
Vendor import of clang RELEASE_360/rc3 tag r229040 (effectively, 3.6.0 RC3):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc3@229040
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 b556f18..c6af2ed 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.
OpenPOWER on IntegriCloud