aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-01-17 22:16:11 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-01-17 22:16:11 +0000
commitde03c15ad92b44a4be11507ca2501bb9dd014dce (patch)
tree3a4c1281f6fcbb89d0bba86df9846b046cf3dc7e /lib/Parse/ParseDecl.cpp
parent995e4a7530d705147c875b63608532c483c011a8 (diff)
Parsing support for C11's _Noreturn keyword. No semantics yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172761 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 74769bf731..f9c68c79b9 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -2619,6 +2619,11 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
case tok::kw_explicit:
isInvalid = DS.setFunctionSpecExplicit(Loc);
break;
+ case tok::kw__Noreturn:
+ if (!getLangOpts().C11)
+ Diag(Loc, diag::ext_c11_noreturn);
+ isInvalid = DS.setFunctionSpecNoreturn(Loc);
+ break;
// alignment-specifier
case tok::kw__Alignas:
@@ -3878,6 +3883,7 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) {
case tok::kw_inline:
case tok::kw_virtual:
case tok::kw_explicit:
+ case tok::kw__Noreturn:
// friend keyword.
case tok::kw_friend: