<div dir="ltr">Thanks Eric for fixing this! Sorry this slipped my notice... WG21 has been busy.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 16, 2013 at 5:48 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Mon, Apr 15, 2013 at 11:29 AM, David Dean <<a href="mailto:david_dean@apple.com">david_dean@apple.com</a>> wrote:<br>

> Richard,<br>
>         Can you XFAIL SemaCXX/cxx11-thread-local.cpp on darwin10? It's passing on darwin11, but not darwin10. My understanding is that this is expected.<br>
<br>
</div>Still seeing this <a href="http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb" target="_blank">http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb</a><br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> On 15 Apr 2013, at 1:33 AM, Richard Smith <<a href="mailto:richard-llvm@metafoo.co.uk">richard-llvm@metafoo.co.uk</a>> wrote:<br>
><br>
>> Author: rsmith<br>
>> Date: Mon Apr 15 03:33:22 2013<br>
>> New Revision: 179517<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=179517&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=179517&view=rev</a><br>
>> Log:<br>
>> Local thread_local variables are implicitly 'static'. (This doesn't apply to _Thread_local nor __thread.)<br>
>><br>
>> Added:<br>
>>    cfe/trunk/test/SemaCXX/cxx11-thread-local.cpp<br>
>> Modified:<br>
>>    cfe/trunk/lib/Sema/SemaDecl.cpp<br>
>>    cfe/trunk/test/Sema/thread-specifier.c<br>
>><br>
>> Modified: cfe/trunk/lib/Sema/SemaDecl.cpp<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=179517&r1=179516&r2=179517&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=179517&r1=179516&r2=179517&view=diff</a><br>

>> ==============================================================================<br>
>> --- cfe/trunk/lib/Sema/SemaDecl.cpp (original)<br>
>> +++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Apr 15 03:33:22 2013<br>
>> @@ -4687,8 +4687,7 @@ Sema::ActOnVariableDeclarator(Scope *S,<br>
>>          "Parser allowed 'typedef' as storage class VarDecl.");<br>
>>   VarDecl::StorageClass SC = StorageClassSpecToVarDeclStorageClass(SCSpec);<br>
>><br>
>> -  if (getLangOpts().OpenCL && !getOpenCLOptions().cl_khr_fp16)<br>
>> -  {<br>
>> +  if (getLangOpts().OpenCL && !getOpenCLOptions().cl_khr_fp16) {<br>
>>     // OpenCL v1.2 s6.1.1.1: reject declaring variables of the half and<br>
>>     // half array type (unless the cl_khr_fp16 extension is enabled).<br>
>>     if (Context.getBaseElementType(R)->isHalfType()) {<br>
>> @@ -4705,6 +4704,16 @@ Sema::ActOnVariableDeclarator(Scope *S,<br>
>>     SC = SC_None;<br>
>>   }<br>
>><br>
>> +  // C++11 [dcl.stc]p4:<br>
>> +  //   When thread_local is applied to a variable of block scope the<br>
>> +  //   storage-class-specifier static is implied if it does not appear<br>
>> +  //   explicitly.<br>
>> +  // Core issue: 'static' is not implied if the variable is declared 'extern'.<br>
>> +  if (SCSpec == DeclSpec::SCS_unspecified &&<br>
>> +      D.getDeclSpec().getThreadStorageClassSpec() ==<br>
>> +          DeclSpec::TSCS_thread_local && DC->isFunctionOrMethod())<br>
>> +    SC = SC_Static;<br>
>> +<br>
>>   IdentifierInfo *II = Name.getAsIdentifierInfo();<br>
>>   if (!II) {<br>
>>     Diag(D.getIdentifierLoc(), diag::err_bad_variable_name)<br>
>><br>
>> Modified: cfe/trunk/test/Sema/thread-specifier.c<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/thread-specifier.c?rev=179517&r1=179516&r2=179517&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/thread-specifier.c?rev=179517&r1=179516&r2=179517&view=diff</a><br>

>> ==============================================================================<br>
>> --- cfe/trunk/test/Sema/thread-specifier.c (original)<br>
>> +++ cfe/trunk/test/Sema/thread-specifier.c Mon Apr 15 03:33:22 2013<br>
>> @@ -42,8 +42,6 @@ int f(__thread int t7) { // expected-err<br>
>>   // expected-error@-2 {{'__thread' variables must have global storage}}<br>
>> #elif defined(C11)<br>
>>   // expected-error@-4 {{'_Thread_local' variables must have global storage}}<br>
>> -#else<br>
>> -  // expected-error@-6 {{'thread_local' variables must have global storage}}<br>
>> #endif<br>
>>   extern __thread int t9;<br>
>>   static __thread int t10;<br>
>> @@ -51,9 +49,9 @@ int f(__thread int t7) { // expected-err<br>
>> #if __cplusplus < 201103L<br>
>>   __thread auto int t12a; // expected-error-re {{cannot combine with previous '(__thread|_Thread_local)' declaration specifier}}<br>
>>   auto __thread int t12b; // expected-error {{cannot combine with previous 'auto' declaration specifier}}<br>
>> -#else<br>
>> -  __thread auto t12a = 0; // expected-error-re {{'(t|_T)hread_local' variables must have global storage}}<br>
>> -  auto __thread t12b = 0; // expected-error-re {{'(t|_T)hread_local' variables must have global storage}}<br>
>> +#elif !defined(CXX11)<br>
>> +  __thread auto t12a = 0; // expected-error-re {{'_Thread_local' variables must have global storage}}<br>
>> +  auto __thread t12b = 0; // expected-error-re {{'_Thread_local' variables must have global storage}}<br>
>> #endif<br>
>>   __thread register int t13a; // expected-error-re {{cannot combine with previous '(__thread|_Thread_local|thread_local)' declaration specifier}}<br>
>>   register __thread int t13b; // expected-error {{cannot combine with previous 'register' declaration specifier}}<br>
>><br>
>> Added: cfe/trunk/test/SemaCXX/cxx11-thread-local.cpp<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx11-thread-local.cpp?rev=179517&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx11-thread-local.cpp?rev=179517&view=auto</a><br>

>> ==============================================================================<br>
>> --- cfe/trunk/test/SemaCXX/cxx11-thread-local.cpp (added)<br>
>> +++ cfe/trunk/test/SemaCXX/cxx11-thread-local.cpp Mon Apr 15 03:33:22 2013<br>
>> @@ -0,0 +1,23 @@<br>
>> +// RUN: %clang_cc1 -std=c++11 -verify %s<br>
>> +<br>
>> +struct S {<br>
>> +  static thread_local int a;<br>
>> +  static int b; // expected-note {{here}}<br>
>> +  thread_local int c; // expected-error {{'thread_local' is only allowed on variable declarations}}<br>
>> +  static thread_local int d; // expected-note {{here}}<br>
>> +};<br>
>> +<br>
>> +thread_local int S::a;<br>
>> +thread_local int S::b; // expected-error {{thread-local declaration of 'b' follows non-thread-local declaration}}<br>
>> +thread_local int S::c; // expected-error {{non-static data member defined out-of-line}}<br>
>> +int S::d; // expected-error {{non-thread-local declaration of 'd' follows thread-local declaration}}<br>
>> +<br>
>> +thread_local int x[3];<br>
>> +thread_local int y[3];<br>
>> +thread_local int z[3]; // expected-note {{previous}}<br>
>> +<br>
>> +void f() {<br>
>> +  thread_local int x;<br>
>> +  static thread_local int y;<br>
>> +  extern thread_local int z; // expected-error {{redefinition of 'z' with a different type}}<br>
>> +}<br>
>><br>
>><br>
>> _______________________________________________<br>
>> cfe-commits mailing list<br>
>> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
><br>
> -David<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div>