================
Comment at: lib/Sema/SemaDecl.cpp:8928-8934
@@ +8927,9 @@
+    const CXXRecordDecl *RD = var->getType()->getAsCXXRecordDecl();
+    if (RD && RD->hasNonTrivialDefaultConstructor()) {
+      // MSVC doesn't allow thread local variables with any constructors, but 
we
+      // only look for the default constructor.
+      Diag(var->getLocation(), diag::err_thread_nontrivial_ctor);
+      if (getLangOpts().CPlusPlus11)
+        Diag(var->getLocation(), diag::note_use_thread_local);
+    }
+  }
----------------
Richard Smith wrote:
> This seems really weird. We're already checking for non-constant 
> initialization; do you have any idea what this check is for? You can check 
> for 'any constructor' using `CXXRecordDecl::hasUserDeclaredConstructor`.
Yeah, this was broken.  I fixed the TLS_Static check below in r207675, and it 
works for __declspec(thread), so I nuked this code.

http://reviews.llvm.org/D3551



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to