public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60393] New: [c++1y] ICE with with invalid functions with auto parameters
@ 2014-03-02 21:54 reichelt at gcc dot gnu.org
2014-03-08 9:33 ` [Bug c++/60393] " abutcher at gcc dot gnu.org
2014-03-08 11:53 ` abutcher at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-03-02 21:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60393
Bug ID: 60393
Summary: [c++1y] ICE with with invalid functions with auto
parameters
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Keywords: error-recovery, ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: reichelt at gcc dot gnu.org
CC: abutcher at gcc dot gnu.org
The following invalid code snippets (compiled with "-std=c++1y") trigger
an ICE on trunk:
==============================
void (*f)(auto) + 0;
struct A
{
int i;
};
==============================
bug.cc:1:17: error: expected initializer before '+' token
void (*f)(auto) + 0;
^
bug.cc:5:7: error: data member 'i' cannot be a member template
int i;
^
bug.cc:5:7: internal compiler error: in poplevel, at cp/decl.c:568
0x5c54a3 poplevel(int, int, int)
../../gcc/gcc/cp/decl.c:568
0x5feba8 end_template_decl()
../../gcc/gcc/cp/pt.c:3807
0x6a3941 finish_fully_implicit_template
../../gcc/gcc/cp/parser.c:32052
0x6acafc cp_parser_member_declaration
../../gcc/gcc/cp/parser.c:20487
0x6afa74 cp_parser_member_specification_opt
../../gcc/gcc/cp/parser.c:20034
0x6afa74 cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:19268
0x6afa74 cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:19495
0x6afa74 cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:14305
0x6c8f70 cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:11547
0x6cfb49 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11137
0x6b2ff3 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:11086
0x6da2b2 cp_parser_declaration
../../gcc/gcc/cp/parser.c:10983
0x6d8fa8 cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:10869
0x6da85a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4014
0x6da85a c_parse_file()
../../gcc/gcc/cp/parser.c:31595
0x7f9f53 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]
==============================
struct A
{
void foo();
};
void A::foo(auto) {}
struct B
{
int i;
};
==============================
bug.cc:6:6: error: prototype for 'void A::foo(auto:1)' does not match any in
class 'A'
void A::foo(auto) {}
^
bug.cc:3:8: error: candidate is: void A::foo()
void foo();
^
bug.cc:10:7: error: data member 'i' cannot be a member template
int i;
^
bug.cc:10:7: internal compiler error: in poplevel, at cp/decl.c:568
0x5c54a3 poplevel(int, int, int)
../../gcc/gcc/cp/decl.c:568
0x5feba8 end_template_decl()
../../gcc/gcc/cp/pt.c:3807
0x6a3941 finish_fully_implicit_template
../../gcc/gcc/cp/parser.c:32052
0x6acafc cp_parser_member_declaration
../../gcc/gcc/cp/parser.c:20487
0x6afa74 cp_parser_member_specification_opt
../../gcc/gcc/cp/parser.c:20034
0x6afa74 cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:19268
0x6afa74 cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:19495
0x6afa74 cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:14305
0x6c8f70 cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:11547
0x6cfb49 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11137
0x6b2ff3 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:11086
0x6da2b2 cp_parser_declaration
../../gcc/gcc/cp/parser.c:10983
0x6d8fa8 cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:10869
0x6da85a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4014
0x6da85a c_parse_file()
../../gcc/gcc/cp/parser.c:31595
0x7f9f53 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]
Adam, these look similar to PR60377 you just fixed.
Could you please have a look?
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/60393] [c++1y] ICE with with invalid functions with auto parameters
2014-03-02 21:54 [Bug c++/60393] New: [c++1y] ICE with with invalid functions with auto parameters reichelt at gcc dot gnu.org
@ 2014-03-08 9:33 ` abutcher at gcc dot gnu.org
2014-03-08 11:53 ` abutcher at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: abutcher at gcc dot gnu.org @ 2014-03-08 9:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60393
--- Comment #1 from Adam Butcher <abutcher at gcc dot gnu.org> ---
Author: abutcher
Date: Sat Mar 8 09:33:03 2014
New Revision: 208426
URL: http://gcc.gnu.org/viewcvs?rev=208426&root=gcc&view=rev
Log:
Fix PR c++/60393
PR c++/60393
* parser.c (cp_parser_parameter_declaration_clause): Move generic
function template unwinding on error into a more general location, ...
(cp_parser_skip_to_end_of_statement): ... here.
PR c++/60393
* g++.dg/cpp1y/pr60393.C: New testcase.
Added:
trunk/gcc/testsuite/g++.dg/cpp1y/pr60393.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/60393] [c++1y] ICE with with invalid functions with auto parameters
2014-03-02 21:54 [Bug c++/60393] New: [c++1y] ICE with with invalid functions with auto parameters reichelt at gcc dot gnu.org
2014-03-08 9:33 ` [Bug c++/60393] " abutcher at gcc dot gnu.org
@ 2014-03-08 11:53 ` abutcher at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: abutcher at gcc dot gnu.org @ 2014-03-08 11:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60393
Adam Butcher <abutcher at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
Assignee|unassigned at gcc dot gnu.org |abutcher at gcc dot gnu.org
Target Milestone|--- |4.9.0
--- Comment #2 from Adam Butcher <abutcher at gcc dot gnu.org> ---
Fixed in 4.9.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-08 11:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-02 21:54 [Bug c++/60393] New: [c++1y] ICE with with invalid functions with auto parameters reichelt at gcc dot gnu.org
2014-03-08 9:33 ` [Bug c++/60393] " abutcher at gcc dot gnu.org
2014-03-08 11:53 ` abutcher at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).