[Bug c++/107864] [10/11/12/13 Regression] ICE (seg fault) in check_return_expr or instantiate_body with concepts and specialized version
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Nov 24 21:55:24 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107864
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10/11/12/13 Regression] |[10/11/12/13 Regression]
|ICE (seg fault) in |ICE (seg fault) in
|check_return_expr with |check_return_expr or
|concepts and specialized |instantiate_body with
|version |concepts and specialized
| |version
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note without the concept there, GCC does not ICE.
Note changing it slightly (remove the if return type):
template<class T>
void j( T const& val ) requires true {}
template<> void j( int const& val ) { }
void g() {
j(1);
}
--- CUT ---
Gives a different ICE:
t.cc: In instantiation of ‘void j(const T&) requires true [with T = int]’:
t.cc:5:4: required from here
t.cc:2:39: internal compiler error: Segmentation fault
2 | void j( T const& val ) requires true {}
| ^
0x120e72f crash_signal
/home/apinski/src/upstream-gcc/gcc/gcc/toplev.cc:314
0xbd42d1 instantiate_body
/home/apinski/src/upstream-gcc/gcc/gcc/cp/pt.cc:26494
0xbd52ba instantiate_decl(tree_node*, bool, bool)
/home/apinski/src/upstream-gcc/gcc/gcc/cp/pt.cc:26774
0xbf2b2b instantiate_pending_templates(int)
/home/apinski/src/upstream-gcc/gcc/gcc/cp/pt.cc:26852
0xaaa7fb c_parse_final_cleanups()
/home/apinski/src/upstream-gcc/gcc/gcc/cp/decl2.cc:4940
0xcd38b0 c_common_parse_file()
/home/apinski/src/upstream-gcc/gcc/gcc/c-family/c-opts.cc:1266
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
More information about the Gcc-bugs
mailing list