re PR c++/34892 (ICE with ellipsis in default template argument)
/cp 2012-10-25 Paolo Carlini <paolo.carlini@oracle.com> PR c++/34892 * parser.c (cp_parser_template_parameter): When cp_parser_parameter_declaration parsed a default argument don't see if *is_parameter_pack needs setting. /testsuite 2012-10-25 Paolo Carlini <paolo.carlini@oracle.com> PR c++/34892 * g++.dg/template/crash114.C: New. From-SVN: r192802
This commit is contained in:
parent
dc3e0b5501
commit
3a969a32ff
@ -1,3 +1,10 @@
|
||||
2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/34892
|
||||
* parser.c (cp_parser_template_parameter): When
|
||||
cp_parser_parameter_declaration parsed a default argument don't
|
||||
see if *is_parameter_pack needs setting.
|
||||
|
||||
2012-10-23 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/54922
|
||||
|
@ -12258,12 +12258,21 @@ cp_parser_template_parameter (cp_parser* parser, bool *is_non_type,
|
||||
parameter_declarator->declarator->parameter_pack_p = false;
|
||||
}
|
||||
|
||||
if (parameter_declarator
|
||||
&& parameter_declarator->default_argument)
|
||||
{
|
||||
/* Can happen in some cases of erroneous input (c++/34892). */
|
||||
if (cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS))
|
||||
/* Consume the `...' for better error recovery. */
|
||||
cp_lexer_consume_token (parser->lexer);
|
||||
}
|
||||
/* If the next token is an ellipsis, and we don't already have it
|
||||
marked as a parameter pack, then we have a parameter pack (that
|
||||
has no declarator). */
|
||||
if (!*is_parameter_pack
|
||||
&& cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS)
|
||||
&& declarator_can_be_parameter_pack (parameter_declarator->declarator))
|
||||
else if (!*is_parameter_pack
|
||||
&& cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS)
|
||||
&& (declarator_can_be_parameter_pack
|
||||
(parameter_declarator->declarator)))
|
||||
{
|
||||
/* Consume the `...'. */
|
||||
cp_lexer_consume_token (parser->lexer);
|
||||
|
@ -1,7 +1,12 @@
|
||||
2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/34892
|
||||
* g++.dg/template/crash114.C: New.
|
||||
|
||||
2012-10-24 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR bootstrap/55049
|
||||
* gcc.target/i386/pr55049-1.c: New test.
|
||||
* gcc.target/i386/pr55049-1.c: New test.
|
||||
|
||||
2012-10-24 Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
|
5
gcc/testsuite/g++.dg/template/crash114.C
Normal file
5
gcc/testsuite/g++.dg/template/crash114.C
Normal file
@ -0,0 +1,5 @@
|
||||
// PR c++/34892
|
||||
|
||||
template<int=..., int=0> struct A {}; // { dg-error "expected primary" }
|
||||
|
||||
A<0> a;
|
Loading…
Reference in New Issue
Block a user