produce a more informative error message when _Thread_local is used

This commit is contained in:
noneofyourbusiness 2022-12-03 20:09:11 +01:00
parent 894e166ecf
commit ab39d34dde
No known key found for this signature in database
GPG key ID: FF810A8659912F5A
2 changed files with 3 additions and 0 deletions

View file

@ -4662,6 +4662,8 @@ static int parse_btype(CType *type, AttributeDef *ad, int ignore_label)
if (type1.ref) if (type1.ref)
sym_to_attr(ad, type1.ref); sym_to_attr(ad, type1.ref);
goto basic_type2; goto basic_type2;
case TOK_THREAD_LOCAL:
tcc_error("_Thread_local is not implemented");
default: default:
if (typespec_found) if (typespec_found)
goto the_end; goto the_end;

View file

@ -38,6 +38,7 @@
DEF(TOK_RESTRICT2, "__restrict") DEF(TOK_RESTRICT2, "__restrict")
DEF(TOK_RESTRICT3, "__restrict__") DEF(TOK_RESTRICT3, "__restrict__")
DEF(TOK_EXTENSION, "__extension__") /* gcc keyword */ DEF(TOK_EXTENSION, "__extension__") /* gcc keyword */
DEF(TOK_THREAD_LOCAL, "_Thread_local") /* C11 thread-local storage */
DEF(TOK_GENERIC, "_Generic") DEF(TOK_GENERIC, "_Generic")
DEF(TOK_STATIC_ASSERT, "_Static_assert") DEF(TOK_STATIC_ASSERT, "_Static_assert")