https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65072
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target|Archlinux Kernel 3.16.3, | |Intel x86_64 | Status|UNCONFIRMED |NEW Last reconfirmed| |2015-02-15 CC| |trippels at gcc dot gnu.org Host|Archlinux Kernel 3.16.3, | |Intel x86_64 | Ever confirmed|0 |1 --- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- Attached testcase only crashes with gcc-4.8 and gcc-4.9. Reduced testcase crashes with all supported versions: markus@x4 testc % cat main.ii template <typename> class CMatrix44 { struct { int xx; }; auto operator*(const CMatrix44 m) -> CMatrix44<decltype (m.xx)>; }; using CMatrix44f = CMatrix44<float>; void fn1 (const CMatrix44<float>); CMatrix44f a; markus@x4 testc % /g++ -c -std=c++11 main.ii main.ii: In instantiation of ‘class CMatrix44<float>’: main.ii:12:12: required from here main.ii:7:8: internal compiler error: Segmentation fault auto operator*(const CMatrix44 m) -> CMatrix44<decltype (m.xx)>; ^ 0xca24ff crash_signal ../../gcc/gcc/toplev.c:383 0x75a4e0 build_class_member_access_expr(tree_node*, tree_node*, tree_node*, bool, int) ../../gcc/gcc/cp/typeck.c:2319 0x75a8d6 build_class_member_access_expr(tree_node*, tree_node*, tree_node*, bool, int) ../../gcc/gcc/cp/typeck.c:2409 0x75b19b finish_class_member_access_expr(tree_node*, tree_node*, bool, int) ../../gcc/gcc/cp/typeck.c:2813 0x6713f0 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc/gcc/cp/pt.c:15446 0x675276 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:12530 0x68bb1a tsubst_template_args ../../gcc/gcc/cp/pt.c:10257 0x6833c0 tsubst_aggr_type ../../gcc/gcc/cp/pt.c:10454 0x6757db tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:11909 0x68a598 tsubst_function_type ../../gcc/gcc/cp/pt.c:11614 0x675916 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:12357 0x6838de tsubst_decl ../../gcc/gcc/cp/pt.c:10845 0x675d36 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:11830 0x6a8900 instantiate_class_template_1 ../../gcc/gcc/cp/pt.c:9374 0x6a8900 instantiate_class_template(tree_node*) ../../gcc/gcc/cp/pt.c:9688 0x73f56b complete_type(tree_node*) ../../gcc/gcc/cp/typeck.c:146 0x6222b7 start_decl_1(tree_node*, bool) ../../gcc/gcc/cp/decl.c:4898 0x641167 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**) ../../gcc/gcc/cp/decl.c:4861 0x72cde5 cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:17153 0x72ebbc cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:11592 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.