Bug 84541 - ICE with auto in function parameter
Summary: ICE with auto in function parameter
Status: RESOLVED DUPLICATE of bug 84798
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2018-02-24 15:19 UTC by Volker Reichelt
Modified: 2018-03-13 20:12 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-02-26 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2018-02-24 15:19:59 UTC
The following invalid code snippet (compiled with "-fconcepts") triggers
an ICE since GCC 6.1.0:

===========================================
template<typename> struct A
{
  static const bool b = true;
};

static_assert(A<void(auto)>::b, "");
===========================================

bug.cc:6:36: internal compiler error: Segmentation fault
 static_assert(A<void(auto)>::b, "");
                                    ^
0xeb1cef crash_signal
	../../gcc/gcc/toplev.c:325
0x99e667 add_stmt(tree_node*)
	../../gcc/gcc/cp/semantics.c:390
0x9129e1 cp_parser_static_assert
	../../gcc/gcc/cp/parser.c:13936
0x93d35e cp_parser_block_declaration
	../../gcc/gcc/cp/parser.c:12866
0x940f32 cp_parser_declaration
	../../gcc/gcc/cp/parser.c:12767
0x941341 cp_parser_declaration_seq_opt
	../../gcc/gcc/cp/parser.c:12643
0x941634 cp_parser_translation_unit
	../../gcc/gcc/cp/parser.c:4559
0x941634 c_parse_file()
	../../gcc/gcc/cp/parser.c:38866
0xa3f966 c_common_parse_file()
	../../gcc/gcc/c-family/c-opts.c:1132
Please submit a full bug report, [etc.]
Comment 1 Paolo Carlini 2018-02-26 15:10:42 UTC
I don't think -fconcepts has anything to do with this and it doesn't look like an [8 regression], in fact I can reproduce it with -std=c++14 even in gcc-5-branch.
Comment 2 Volker Reichelt 2018-02-26 19:51:11 UTC
Paolo, you're right. Sorry for the noise.

The "-fconcept" parameter is a left-over from the larger testcase where this snippet was derived from.

The ICE can be reproduced with GCC 4.9.0 and only needs "-std=c++14" or "-std=c++1y" to be triggered.
Comment 3 Volker Reichelt 2018-03-13 20:12:19 UTC
Duplicate of PR84798.

*** This bug has been marked as a duplicate of bug 84798 ***