From d184e0c062dd6ac5543bc579372874c1109a2f8e Mon Sep 17 00:00:00 2001 From: jsm28 Date: Tue, 12 Nov 2013 17:38:47 +0000 Subject: c-family: * c-common.c (c_common_reswords): Add _Thread_local. c: * c-tree.h (struct c_declspecs): Add thread_gnu_p field. * c-parser.c (c_parser_declspecs): Mention _Thread_local in comment. * c-decl.c (shadow_tag_warned, grokdeclarator): Mention __thread or _Thread_local as appropriate in diagnostics. (build_null_declspecs): Initialize ret->thread_gnu_p. (declspecs_add_scspec): Handle either __thread or _Thread_local for RID_THREAD. Diagnose _Thread_local for pre-C11 standards if pedantic. Do not disallow _Thread_local extern and _Thread_local static. testsuite: * gcc.dg/c90-thread-local-1.c, gcc.dg/c99-thread-local-1.c, gcc.dg/c11-thread-local-1.c, gcc.dg/c11-thread-local-2.c: New tests. * gcc.dg/tls/diag-2.c, objc.dg/tls/diag-2.m: Update expected diagnostics. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204711 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c/c-tree.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/c/c-tree.h') diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h index 8dffa9c1674..502fdca4d7e 100644 --- a/gcc/c/c-tree.h +++ b/gcc/c/c-tree.h @@ -320,8 +320,10 @@ struct c_declspecs { BOOL_BITFIELD inline_p : 1; /* Whether "_Noreturn" was speciied. */ BOOL_BITFIELD noreturn_p : 1; - /* Whether "__thread" was specified. */ + /* Whether "__thread" or "_Thread_local" was specified. */ BOOL_BITFIELD thread_p : 1; + /* Whether "__thread" rather than "_Thread_local" was specified. */ + BOOL_BITFIELD thread_gnu_p : 1; /* Whether "const" was specified. */ BOOL_BITFIELD const_p : 1; /* Whether "volatile" was specified. */ -- cgit v1.2.1