https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65636
Bug ID: 65636 Summary: [c++-concepts] ICE (Segmentation fault) when a type requirement names a typedef or type alias Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tom at honermann dot net Encountered with the latest revision of the gcc c++-concepts branch (r221742). An internal compiler error occurs when a type requirement names a typedef or type alias. I suspect this code is ill-formed - a proper diagnostic is produced if a builtin type (ie, 'int') is named in lieu of the type alias. $ svn info # From my local svn gcc repo. Path: . URL: svn://gcc.gnu.org/svn/gcc/branches/c++-concepts Repository Root: svn://gcc.gnu.org/svn/gcc Repository UUID: 138bc75d-0d04-0410-961f-82ee72b054a4 Revision: 221742 Node Kind: directory Schedule: normal Last Changed Author: asutton Last Changed Rev: 221733 Last Changed Date: 2015-03-27 10:44:22 -0400 (Fri, 27 Mar 2015) $ cat t.cpp using TD = int; template<typename T> concept bool C() { return requires () { typename TD; }; } static_assert(C<int>(), ""); $ g++ -c -std=c++1z t.cpp t.cpp:1:13: internal compiler error: Segmentation fault typedef int TD; ^ 0xcc91ef crash_signal ../../gcc-c++-concepts2/c++-concepts/gcc/toplev.c:383 0x6754ff tsubst_decl ../../gcc-c++-concepts2/c++-concepts/gcc/cp/pt.c:11859 0x68b9c6 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/pt.c:12388 0x82eb81 tsubst_type_requirement ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:1390 0x82eb81 tsubst_requirement ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:1426 0x82eb81 tsubst_requirement_body ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:1446 0x82eb81 tsubst_requires_expr(tree_node*, tree_node*, int, tree_node*) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:1476 0x67ca83 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/pt.c:16301 0x682b56 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/pt.c:14970 0x82da7f lift_function_definition ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:340 0x82db43 evaluate_function_concept(tree_node*, tree_node*) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:1885 0x620cc3 build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, int) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/call.c:4161 0x79f4da finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/semantics.c:2407 0x7269c7 cp_parser_postfix_expression ../../gcc-c++-concepts2/c++-concepts/gcc/cp/parser.c:6448 0x729219 cp_parser_unary_expression ../../gcc-c++-concepts2/c++-concepts/gcc/cp/parser.c:7511 0x729e07 cp_parser_binary_expression ../../gcc-c++-concepts2/c++-concepts/gcc/cp/parser.c:8245 0x72a61f cp_parser_assignment_expression ../../gcc-c++-concepts2/c++-concepts/gcc/cp/parser.c:8503 0x72a9f5 cp_parser_constant_expression ../../gcc-c++-concepts2/c++-concepts/gcc/cp/parser.c:8749 0x72aad4 cp_parser_static_assert ../../gcc-c++-concepts2/c++-concepts/gcc/cp/parser.c:12308 0x721399 cp_parser_block_declaration ../../gcc-c++-concepts2/c++-concepts/gcc/cp/parser.c:11564