re PR c++/37875 ([c++0x] misinterpreted closing angle bracket in decltype operand)
PR c++/37875 * parser.c (cp_parser_decltype): Set greater_than_is_operator_p. From-SVN: r152686
This commit is contained in:
parent
23f392e019
commit
478a716ab7
4 changed files with 24 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
|||
2009-10-12 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/37875
|
||||
* parser.c (cp_parser_decltype): Set greater_than_is_operator_p.
|
||||
|
||||
PR c++/37766
|
||||
* pt.c (type_unification_real): Call convert_template_argument
|
||||
for function default template arguments.
|
||||
|
|
|
@ -9541,12 +9541,25 @@ cp_parser_decltype (cp_parser *parser)
|
|||
cp_parser_parse_definitely (parser);
|
||||
else
|
||||
{
|
||||
bool saved_greater_than_is_operator_p;
|
||||
|
||||
/* Abort our attempt to parse an id-expression or member access
|
||||
expression. */
|
||||
cp_parser_abort_tentative_parse (parser);
|
||||
|
||||
/* Within a parenthesized expression, a `>' token is always
|
||||
the greater-than operator. */
|
||||
saved_greater_than_is_operator_p
|
||||
= parser->greater_than_is_operator_p;
|
||||
parser->greater_than_is_operator_p = true;
|
||||
|
||||
/* Parse a full expression. */
|
||||
expr = cp_parser_expression (parser, /*cast_p=*/false, NULL);
|
||||
|
||||
/* The `>' token might be the end of a template-id or
|
||||
template-parameter-list now. */
|
||||
parser->greater_than_is_operator_p
|
||||
= saved_greater_than_is_operator_p;
|
||||
}
|
||||
|
||||
/* Go back to evaluating expressions. */
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
2009-10-12 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/37875
|
||||
* g++.dg/cpp0x/decltype18.C: New.
|
||||
|
||||
PR c++/37766
|
||||
* g++.dg/cpp0x/fntmpdefarg1.C: New.
|
||||
|
||||
|
|
5
gcc/testsuite/g++.dg/cpp0x/decltype18.C
Normal file
5
gcc/testsuite/g++.dg/cpp0x/decltype18.C
Normal file
|
@ -0,0 +1,5 @@
|
|||
// PR c++/37875
|
||||
// { dg-options "-std=c++0x" }
|
||||
|
||||
template <typename> struct X {};
|
||||
X<decltype(1 > 2)> x;
|
Loading…
Add table
Reference in a new issue