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

            Bug ID: 68628
           Summary: [concepts] ICE: segmentation fault in crash_signal,
                    toplev.c:334
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lucdanton at free dot fr
  Target Milestone: ---

The source program was mechanically reduced.

$ g++-trunk --version
g++-trunk (GCC) 6.0.0 20151130 (experimental)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ cat prepro.ii
template <typename, typename> struct is_convertible;
auto functor = [] {};
void forward();
namespace internal {
template <typename Type> Type constant;
struct A {
  template <typename> static auto impl();
};
template <typename Ret> struct B : A {
  template <typename F, typename... Args>
  auto operator()(F, Args... args) requires
      is_convertible<Ret, decltype(impl(forward < Args(args)...))>::value;
};
}
using internal::constant;
namespace functors {
using internal::B;
}
template <typename R> auto invoke_as = constant<functors::B<R>>;
template <typename Ret, typename> bool Invokable{invoke_as<Ret>(forward)};
static_assert ( Invokable < decltype ( functor ), int >
$ g++-trunk -std=c++1z prepro.ii
prepro.ii: In instantiation of 'bool Invokable<<lambda()>, int>':
prepro.ii:21:17:   required from here
prepro.ii:12:40: internal compiler error: Segmentation fault
       is_convertible<Ret, decltype(impl(forward < Args(args)...))>::value;
                                        ^

0xab2e5f crash_signal
        ../../gcc/gcc/toplev.c:334
0x5a61ee resolve_args
        ../../gcc/gcc/cp/call.c:3956
0x5b0eeb build_new_method_call_1
        ../../gcc/gcc/cp/call.c:8161
0x5b0eeb build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        ../../gcc/gcc/cp/call.c:8445
0x692ee0 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ../../gcc/gcc/cp/semantics.c:2360
0x5e9117 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:16451
0x5e9ba8 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:13379
0x5f1d0a tsubst_template_args
        ../../gcc/gcc/cp/pt.c:11077
0x5f220f tsubst_aggr_type
        ../../gcc/gcc/cp/pt.c:11274
0x5ea0f3 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:12743
0x5e6774 tsubst_qualified_id
        ../../gcc/gcc/cp/pt.c:13573
0x5e7531 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:16028
0x5e2b07 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:15620
0x6ea5ba satisfy_predicate_constraint
        ../../gcc/gcc/cp/constraint.cc:1794
0x6ea5ba satisfy_constraint_1
        ../../gcc/gcc/cp/constraint.cc:1998
0x6eaa86 satisfy_constraint
        ../../gcc/gcc/cp/constraint.cc:2049
0x6eab67 constraints_satisfied_p(tree_node*)
        ../../gcc/gcc/cp/constraint.cc:2156
0x5aff95 add_function_candidate
        ../../gcc/gcc/cp/call.c:1994
0x5b061c add_template_candidate_real
        ../../gcc/gcc/cp/call.c:3118
0x5b0a23 add_template_candidate
        ../../gcc/gcc/cp/call.c:3160
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