aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--decl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/decl.c b/decl.c
index 050bf05..11f7c12 100644
--- a/decl.c
+++ b/decl.c
@@ -887,13 +887,18 @@ decl(struct scope *s, struct func *f)
base = declspecs(s, &sc, &fs, &align);
if (!base.type)
return false;
- if (!f) {
+ if (f) {
+ if (sc == SCTHREADLOCAL)
+ error(&tok.loc, "block scope declaration containing '_Thread_local' must contain 'static' or 'extern'");
+ } else {
/* 6.9p2 */
if (sc & SCAUTO)
error(&tok.loc, "external declaration must not contain 'auto'");
if (sc & SCREGISTER)
error(&tok.loc, "external declaration must not contain 'register'");
}
+ if (sc & SCTHREADLOCAL)
+ error(&tok.loc, "'_Thread_local' is not yet supported");
if (consume(TSEMICOLON)) {
/* XXX 6.7p2 error unless in function parameter/struct/union, or tag/enum members are declared */
return true;