From 3d9cbdc3e66e274d5d3cb94ce81a65478d9baae0 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Fri, 15 Apr 2011 00:35:57 +0000 Subject: C1X: implement static asserts llvm-svn: 129555 --- clang/lib/Parse/ParseDecl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'clang/lib/Parse/ParseDecl.cpp') diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 5e6c51c1ee9..ee76cc73a52 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -653,7 +653,7 @@ void Parser::DiagnoseProhibitedAttributes(ParsedAttributesWithRange &attrs) { /// [C++] namespace-definition /// [C++] using-directive /// [C++] using-declaration -/// [C++0x] static_assert-declaration +/// [C++0x/C1X] static_assert-declaration /// others... [FIXME] /// Parser::DeclGroupPtrTy Parser::ParseDeclaration(StmtVector &Stmts, @@ -688,6 +688,7 @@ Parser::DeclGroupPtrTy Parser::ParseDeclaration(StmtVector &Stmts, DeclEnd, attrs); break; case tok::kw_static_assert: + case tok::kw__Static_assert: ProhibitAttributes(attrs); SingleDecl = ParseStaticAssertDeclaration(DeclEnd); break; @@ -2923,6 +2924,9 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) { // typedef-name case tok::annot_typename: + // static_assert-declaration + case tok::kw__Static_assert: + // GNU typeof support. case tok::kw_typeof: -- cgit v1.2.3