diff options
| author | Douglas Gregor <dgregor@apple.com> | 2011-01-11 00:33:19 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2011-01-11 00:33:19 +0000 |
| commit | 94a32477fd9082ef7983aab8d8127d650db0fad7 (patch) | |
| tree | bac761f21a49321893e31a4fdc86fedd226b19fa /clang | |
| parent | 00c84fd1258cf78342c1b02f2e3537789f8defb7 (diff) | |
| download | bcm5719-llvm-94a32477fd9082ef7983aab8d8127d650db0fad7.tar.gz bcm5719-llvm-94a32477fd9082ef7983aab8d8127d650db0fad7.zip | |
When we're inside a functional cast, '>' is an operator. Fixes PR8912.
llvm-svn: 123201
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Parse/ParseExprCXX.cpp | 3 | ||||
| -rw-r--r-- | clang/test/Parser/cxx-template-argument.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index bf4b5f4b166..aa638bb0776 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -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); diff --git a/clang/test/Parser/cxx-template-argument.cpp b/clang/test/Parser/cxx-template-argument.cpp index 532b4c9894b..c85b1c92811 100644 --- a/clang/test/Parser/cxx-template-argument.cpp +++ b/clang/test/Parser/cxx-template-argument.cpp @@ -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; |

