aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaDecl.cpp3
-rw-r--r--test/Sema/thread-specifier.c2
2 files changed, 4 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.
diff --git a/test/Sema/thread-specifier.c b/test/Sema/thread-specifier.c
index ccffe7335f..01bb8f7773 100644
--- a/test/Sema/thread-specifier.c
+++ b/test/Sema/thread-specifier.c
@@ -108,3 +108,5 @@ __thread S s;
#endif
#endif
#endif
+
+__thread int aggregate[10] = {0};