This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/70036] New: [concepts] ICE with a dependent sizeof in a concept


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

            Bug ID: 70036
           Summary: [concepts] ICE with a dependent sizeof in a concept
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ville.voutilainen at gmail dot com
  Target Milestone: ---

Test:

template <class T> concept bool Large = sizeof(T) > 1;

template <class... T>
struct X
{
    X() requires Large<T> = default;
    X() requires !Large<T> = default;
};

int main()
{
    X<int> x;
    X<char> y;
}

This gives:

prog.cc: In function 'int main()':
prog.cc:1:47: internal compiler error: in dependent_type_p, at cp/pt.c:22550
 template <class T> concept bool Large = sizeof(T) > 1;
                                               ^
0x5f5278 dependent_type_p(tree_node*)
        /home/heads/gcc/gcc-source/gcc/cp/pt.c:22550
0x6771c7 cxx_sizeof_or_alignof_type(tree_node*, tree_code, bool)
        /home/heads/gcc/gcc-source/gcc/cp/typeck.c:1569
0x6039da tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/heads/gcc/gcc-source/gcc/cp/pt.c:16234
0x603188 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/heads/gcc/gcc-source/gcc/cp/pt.c:16150
0x5fdb78 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/heads/gcc/gcc-source/gcc/cp/pt.c:15774
0x6f7baa satisfy_predicate_constraint
        /home/heads/gcc/gcc-source/gcc/cp/constraint.cc:1768
0x6f7baa satisfy_constraint_1
        /home/heads/gcc/gcc-source/gcc/cp/constraint.cc:1975
0x6f8066 satisfy_constraint
        /home/heads/gcc/gcc-source/gcc/cp/constraint.cc:2026
0x6f815a constraints_satisfied_p(tree_node*)
        /home/heads/gcc/gcc-source/gcc/cp/constraint.cc:2133
0x5c9ecc add_function_candidate
        /home/heads/gcc/gcc-source/gcc/cp/call.c:1994
0x5ca8ef add_candidates
        /home/heads/gcc/gcc-source/gcc/cp/call.c:5351
0x5cae84 build_new_method_call_1
        /home/heads/gcc/gcc-source/gcc/cp/call.c:8282
0x5cae84 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        /home/heads/gcc/gcc-source/gcc/cp/call.c:8478
0x5c4d8c build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
        /home/heads/gcc/gcc-source/gcc/cp/call.c:8012
0x690bc6 expand_default_init
        /home/heads/gcc/gcc-source/gcc/cp/init.c:1756
0x690bc6 expand_aggr_init_1
        /home/heads/gcc/gcc-source/gcc/cp/init.c:1858
0x691385 build_aggr_init(tree_node*, tree_node*, int, int)
        /home/heads/gcc/gcc-source/gcc/cp/init.c:1606
0x5d739d build_aggr_init_full_exprs
        /home/heads/gcc/gcc-source/gcc/cp/decl.c:5964
0x5d739d check_initializer
        /home/heads/gcc/gcc-source/gcc/cp/decl.c:6108
0x5ed0e4 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        /home/heads/gcc/gcc-source/gcc/cp/decl.c:6783
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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]