[cfe-commits] r123201 - in /cfe/trunk: lib/Parse/ParseExprCXX.cpp test/Parser/cxx-template-argument.cpp

Douglas Gregor dgregor at apple.com
Mon Jan 10 16:33:19 PST 2011


Author: dgregor
Date: Mon Jan 10 18:33:19 2011
New Revision: 123201

URL: http://llvm.org/viewvc/llvm-project?rev=123201&view=rev
Log:
When we're inside a functional cast, '>' is an operator. Fixes PR8912.

Modified:
    cfe/trunk/lib/Parse/ParseExprCXX.cpp
    cfe/trunk/test/Parser/cxx-template-argument.cpp

Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=123201&r1=123200&r2=123201&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Mon Jan 10 18:33:19 2011
@@ -13,6 +13,7 @@
 
 #include "clang/Parse/ParseDiagnostic.h"
 #include "clang/Parse/Parser.h"
+#include "RAIIObjectsForParser.h"
 #include "clang/Sema/DeclSpec.h"
 #include "clang/Sema/ParsedTemplate.h"
 #include "llvm/Support/ErrorHandling.h"
@@ -720,6 +721,8 @@
   ParsedType TypeRep = Actions.ActOnTypeName(getCurScope(), DeclaratorInfo).get();
 
   assert(Tok.is(tok::l_paren) && "Expected '('!");
+  GreaterThanIsOperatorScope G(GreaterThanIsOperator, true);
+
   SourceLocation LParenLoc = ConsumeParen();
 
   ExprVector Exprs(Actions);

Modified: cfe/trunk/test/Parser/cxx-template-argument.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx-template-argument.cpp?rev=123201&r1=123200&r2=123201&view=diff
==============================================================================
--- cfe/trunk/test/Parser/cxx-template-argument.cpp (original)
+++ cfe/trunk/test/Parser/cxx-template-argument.cpp Mon Jan 10 18:33:19 2011
@@ -7,3 +7,6 @@
 A<int+> int x; // expected-error {{expected '>'}} expected-error {{expected unqualified-id}}
 A<int x; // expected-error {{expected '>'}}
 
+// PR8912
+template <bool> struct S {};
+S<bool(2 > 1)> s;





More information about the cfe-commits mailing list