Skip to content

Commit 43c14a7

Browse files
committed
C: add _Thread_local C11 keyword
Signed-off-by: Masatake YAMATO <[email protected]>
1 parent bec7905 commit 43c14a7

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
i input.c /^__thread int i;$/;" v typeref:typename:int properties:thread_local
22
s input.c /^extern __thread struct state s;$/;" x typeref:struct:state properties:extern,thread_local
33
p input.c /^static __thread char *p;$/;" v typeref:typename:char * file: properties:static,thread_local
4+
q input.c /^static _Thread_local char *q;$/;" v typeref:typename:char * file: properties:static,thread_local

Units/parser-c.r/properties-thread.d/input.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
__thread int i;
33
extern __thread struct state s;
44
static __thread char *p;
5+
6+
static _Thread_local char *q;

parsers/cxx/cxx_keyword.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ static CXXKeywordDescriptor g_aCXXKeywordTable[] = {
141141
CXXLanguageC | CXXLanguageCPP,
142142
CXXKeywordMayAppearInVariableDeclaration | CXXKeywordExcludeFromTypeNames,
143143
},
144+
{
145+
"_Thread_local",
146+
CXXLanguageC,
147+
CXXKeywordMayAppearInVariableDeclaration | CXXKeywordExcludeFromTypeNames,
148+
},
144149
{
145150
"alignas",
146151
CXXLanguageCPP,

parsers/cxx/cxx_keyword.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ typedef enum _CXXKeyword
3434
CXXKeyword__STDCALL, // Microsoft C/C++
3535
CXXKeyword__THISCALL, // Microsoft C/C++
3636
CXXKeyword__THREAD, // GCC (https://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/Thread-Local.html#Thread-Local)
37+
CXXKeyword_THREAD_LOCAL, // C11
3738
CXXKeywordALIGNAS, // (since C++11)
3839
CXXKeywordALIGNOF, // (since C++11)
3940
//CXXKeywordAND,

parsers/cxx/cxx_parser_block.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ static bool cxxParserParseBlockInternal(bool bExpectClosingBracket)
648648
break;
649649
case CXXKeywordTHREAD_LOCAL:
650650
case CXXKeyword__THREAD:
651+
case CXXKeyword_THREAD_LOCAL:
651652
g_cxx.uKeywordState |= CXXParserKeywordStateSeenThreadLocal;
652653
break;
653654

0 commit comments

Comments
 (0)