[Bug c++/99831] ICE: in reshape_init, at cp/decl.c:6720

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 30 19:34:34 GMT 2021


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

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Even shorter:

// PR c++/99831

template <int N> struct S {
  constexpr S(const char (&str)[N]) : value{} { }
  char value[N];
};
template <S> struct string {
  constexpr bool operator==(const string &) const = default;
};
template <S L2> void operator+(string<L2>) {
  char value[1];
  S{value};
}
static_assert(string<"a">{} == string<"a">{});


More information about the Gcc-bugs mailing list