]> granicus.if.org Git - clang/commitdiff
Fixup __extension__ i = 1 parsing. Thanks Eli!
authorMike Stump <mrs@apple.com>
Sat, 16 May 2009 04:31:34 +0000 (04:31 +0000)
committerMike Stump <mrs@apple.com>
Sat, 16 May 2009 04:31:34 +0000 (04:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71927 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseExpr.cpp
test/Parser/cxx-throw.cpp

index c3a38b1fe22a58b58b81384f03d10b933d4be855..20c55a1ea38184eb14ec5024a12b9bef30db75c4 100644 (file)
@@ -225,7 +225,7 @@ Parser::ParseExpressionWithLeadingAt(SourceLocation AtLoc) {
 /// process of disambiguating between an expression and a declaration.
 Parser::OwningExprResult
 Parser::ParseExpressionWithLeadingExtension(SourceLocation ExtLoc) {
-  OwningExprResult LHS(ParseAssignmentExpression());
+  OwningExprResult LHS(ParseCastExpression(false));
   if (LHS.isInvalid()) return move(LHS);
 
   LHS = Actions.ActOnUnaryOp(CurScope, ExtLoc, tok::kw___extension__,
index 968ef469f9c112220d600149b1d6806185761cdc..bcc49ec1b4fb5829d1b58491fcdded5d9fe6e15b 100644 (file)
@@ -10,7 +10,6 @@ void foo() {
   throw 1;
   throw;
   1 ? throw : (void)42;
-  // gcc doesn't parse the below, but we do
-  __extension__ throw 1;
+  __extension__ throw 1;    // expected-error {{expected expression}}
   (void)throw;              // expected-error {{expected expression}}
 }