diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2019-09-04 21:01:57 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2019-09-04 21:01:57 +0000 |
commit | c9565ca81a15f7c3a83183427ff16a912d3ff936 (patch) | |
tree | 21b1e9c156a45ac8fd8f2ecc923a72efe81e775c /lib/Parse/ParseDecl.cpp | |
parent | 1237b45db0016d2546eb5c78c81afb46b12ed400 (diff) | |
download | clang-c9565ca81a15f7c3a83183427ff16a912d3ff936.tar.gz |
Diagnose _Atomic as a C11 extension.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370982 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index d66c539056..068964cbf8 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -3924,6 +3924,9 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, // If the _Atomic keyword is immediately followed by a left parenthesis, // it is interpreted as a type specifier (with a type name), not as a // type qualifier. + if (!getLangOpts().C11) + Diag(Tok, diag::ext_c11_feature) << Tok.getName(); + if (NextToken().is(tok::l_paren)) { ParseAtomicSpecifier(DS); continue; @@ -5330,6 +5333,8 @@ void Parser::ParseTypeQualifierListOpt( case tok::kw__Atomic: if (!AtomicAllowed) goto DoneWithTypeQuals; + if (!getLangOpts().C11) + Diag(Tok, diag::ext_c11_feature) << Tok.getName(); isInvalid = DS.SetTypeQual(DeclSpec::TQ_atomic, Loc, PrevSpec, DiagID, getLangOpts()); break; |