]> granicus.if.org Git - clang/commitdiff
When we're inside a functional cast, '>' is an operator. Fixes PR8912.
authorDouglas Gregor <dgregor@apple.com>
Tue, 11 Jan 2011 00:33:19 +0000 (00:33 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 11 Jan 2011 00:33:19 +0000 (00:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123201 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseExprCXX.cpp
test/Parser/cxx-template-argument.cpp

index bf4b5f4b166121330310ef1879572e2a3113d5c5..aa638bb0776adb085658153ac28856fb0f32ab1a 100644 (file)
@@ -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 @@ Parser::ParseCXXTypeConstructExpression(const DeclSpec &DS) {
   ParsedType TypeRep = Actions.ActOnTypeName(getCurScope(), DeclaratorInfo).get();
 
   assert(Tok.is(tok::l_paren) && "Expected '('!");
+  GreaterThanIsOperatorScope G(GreaterThanIsOperator, true);
+
   SourceLocation LParenLoc = ConsumeParen();
 
   ExprVector Exprs(Actions);
index 532b4c9894b7dfa5dff4e17a105a69802aba27bd..c85b1c928111f19f908e8d193867f58a844ac7b4 100644 (file)
@@ -7,3 +7,6 @@ template<typename T> struct A {};
 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;