summaryrefslogtreecommitdiffstats
path: root/clang/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
commit774672e9434cb8d0e54371b7a78d19fa3e1fe5fa (patch)
tree9480e9849961c22e9286cedaa911fbfaffcb8aa3 /clang/lib/Sema/SemaDecl.cpp
parenta8f52c8d88eba776470e2612f5b858fe58f3ad9e (diff)
downloadbcm5719-llvm-774672e9434cb8d0e54371b7a78d19fa3e1fe5fa.tar.gz
bcm5719-llvm-774672e9434cb8d0e54371b7a78d19fa3e1fe5fa.zip
Properly check for a constant initializer for a thread-local variable.
llvm-svn: 179516
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 99702bed1cc..b943e310ffa 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud