Properly check for a constant initializer for a thread-local variable.

llvm-svn: 179516
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 99702be..b943e31 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -7630,7 +7630,8 @@
     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.