diff options
author | Richard Trieu <rtrieu@google.com> | 2012-08-14 23:50:52 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2012-08-14 23:50:52 +0000 |
commit | 1b4b1461da093bfcb85edfb67710d21f79c7f16c (patch) | |
tree | d8b30aa8139e323f1ab9f4204a70a20474c70763 /lib | |
parent | 27ef16b326b9a9dd2440e5d1cc884e27f07e13a3 (diff) |
Check local static variables for self reference on initialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161909 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index b014b4cd9f..6526d01e08 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -6313,7 +6313,7 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, // by a dataflow analysis. // Record types initialized by initializer list are handled here. // Initialization by constructors are handled in TryConstructorInitialization. - if (!VDecl->hasLocalStorage() && !VDecl->isStaticLocal() && + if (!VDecl->hasLocalStorage() && (isa<InitListExpr>(Init) || !VDecl->getType()->isRecordType())) CheckSelfReference(RealDecl, Init); |