diff options
author | Anders Carlsson <andersca@mac.com> | 2009-03-13 23:29:20 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-03-13 23:29:20 +0000 |
commit | ad5f960f9e42568a87bf5e03dce7ad878f9ba6da (patch) | |
tree | 8f3d87b4d8d2d50bc9f3259942be3ab5e2bfed5c | |
parent | 0c3f599bcaf79302caae6183464c9fe4532cbcd2 (diff) |
Pass more sane arguments to ActOnStaticAssertDeclaration
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66983 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Parse/Action.h | 3 | ||||
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 13 |
2 files changed, 5 insertions, 11 deletions
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h index 0a736f13a1..3900e38da7 100644 --- a/include/clang/Parse/Action.h +++ b/include/clang/Parse/Action.h @@ -884,9 +884,8 @@ public: virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, DeclTy *Method) { } - virtual DeclTy *ActOnStaticAssertDeclaration(SourceLocation LParenLoc, + virtual DeclTy *ActOnStaticAssertDeclaration(SourceLocation AssertLoc, ExprArg AssertExpr, - SourceLocation CommaLoc, ExprArg AssertMessageExpr, SourceLocation RParenLoc) { return 0; diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index b21ac778ba..f534f42ccb 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -239,14 +239,9 @@ Parser::DeclTy *Parser::ParseStaticAssertDeclaration() { return 0; } - if (Tok.isNot(tok::comma)) { - Diag(Tok, diag::err_expected_comma); - SkipUntil(tok::semi); + if (ExpectAndConsume(tok::comma, diag::err_expected_comma, "", tok::semi)) return 0; - } - - SourceLocation CommaLoc = ConsumeToken(); - + if (Tok.isNot(tok::string_literal)) { Diag(Tok, diag::err_expected_string_literal); SkipUntil(tok::semi); @@ -261,8 +256,8 @@ Parser::DeclTy *Parser::ParseStaticAssertDeclaration() { ExpectAndConsume(tok::semi, diag::err_expected_semi_after_static_assert); - return Actions.ActOnStaticAssertDeclaration(LParenLoc, move(AssertExpr), - CommaLoc, move(AssertMessage), + return Actions.ActOnStaticAssertDeclaration(StaticAssertLoc, move(AssertExpr), + move(AssertMessage), RParenLoc); } |