]> granicus.if.org Git - clang/commitdiff
Pass more sane arguments to ActOnStaticAssertDeclaration
authorAnders Carlsson <andersca@mac.com>
Fri, 13 Mar 2009 23:29:20 +0000 (23:29 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 13 Mar 2009 23:29:20 +0000 (23:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66983 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Parse/Action.h
lib/Parse/ParseDeclCXX.cpp

index 0a736f13a12ff8564acec33f715d13ef6c1cc8d0..3900e38da79c08745c8d1b3f3ab00c5d72c1e991 100644 (file)
@@ -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;
index b21ac778ba5cecd2e42a4ae8efd82fa3cda9e416..f534f42ccb82572ee10bd12d6f9680bc8eb134a8 100644 (file)
@@ -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);
 }