aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-04-15 08:07:34 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-04-15 08:07:34 +0000
commitb6b127f279f89d992e0713866f17fed267147a79 (patch)
tree5d89b69b1b8163668c7a8fe3c8488de2c886c474 /lib/Sema/SemaDecl.cpp
parent231dbd23f1053b198dcacbed89b73ede907020d4 (diff)
Properly check for a constant initializer for a thread-local variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 99702bed1c..b943e310ff 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -7630,7 +7630,8 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init,
else if (VDecl->getTLSKind() == VarDecl::TLS_Static &&
!VDecl->isInvalidDecl() && !DclT->isDependentType() &&
!Init->isValueDependent() && !VDecl->isConstexpr() &&
- !Init->isEvaluatable(Context)) {
+ !Init->isConstantInitializer(
+ Context, VDecl->getType()->isReferenceType())) {
// GNU C++98 edits for __thread, [basic.start.init]p4:
// An object of thread storage duration shall not require dynamic
// initialization.