https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67007

            Bug ID: 67007
           Summary: [c++-concepts] Deduction constraint
           Product: gcc
           Version: c++-concepts
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Casey at Carter dot net
  Target Milestone: ---

r226205 ICEs compiling this program:

template <class U>
concept bool A =
  requires (U u) { u; };

template <class T>
concept bool B =
  requires (T t) { { t } -> A; };

void foo(B);

apparently while normalizing the constraints of B:

~/concept-gcc/bin/g++ -std=c++1z foo.cpp -c
foo.cpp:9:11: internal compiler error: in tsubst_constraint, at
cp/constraint.cc:1511
 void foo(B);
           ^
0x8032b1 tsubst_constraint(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/cp/constraint.cc:1511
0x65794f tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/cp/pt.c:12798
0x806bf0 tsubst_compound_requirement
        ../../gcc/cp/constraint.cc:1604
0x806bf0 tsubst_requirement
        ../../gcc/cp/constraint.cc:1632
0x806bf0 tsubst_requirement_body
        ../../gcc/cp/constraint.cc:1651
0x806bf0 tsubst_requires_expr(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/cp/constraint.cc:1682
0x65103a tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:16429
0x64462e tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:15092
0x80591f lift_variable_initializer
        ../../gcc/cp/constraint.cc:440
0x805220 normalize_predicate_constraint
        ../../gcc/cp/constraint.cc:955
0x805220 normalize_constraint
        ../../gcc/cp/constraint.cc:993
0x805508 build_constraints(tree_node*, tree_node*)
        ../../gcc/cp/constraint.cc:1096
0x5af175 grokfndecl
        ../../gcc/cp/decl.c:7788
0x6208f6 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        ../../gcc/cp/decl.c:11202
0x621126 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ../../gcc/cp/decl.c:4744
0x710580 cp_parser_init_declarator
        ../../gcc/cp/parser.c:17728
0x71336d cp_parser_simple_declaration
        ../../gcc/cp/parser.c:11685
0x70c8f4 cp_parser_block_declaration
        ../../gcc/cp/parser.c:11559
0x718783 cp_parser_declaration
        ../../gcc/cp/parser.c:11456
0x716f5a cp_parser_declaration_seq_opt
        ../../gcc/cp/parser.c:11338
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.

Reply via email to