[Bug c++/92010] [8/9/10 Regression] gcc internal error since 8x on warning write-strings

ppalka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 12 22:54:11 GMT 2020


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

--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
The ICE seems to be revealing a latent issue:  In the following example (which
GCC accepts), according to the static_assert labelled (1), the type of t is
const int*, but according to the static_assert labelled (2), the type of t is
int *const.



template <typename T>
void foo(const T t)
{
  static_assert(__is_same(decltype(t), const int*));  // (1)
}

static_assert(__is_same(decltype(foo<int[]>), void(int *)));  // (2)

int
main()
{
  foo<int[]>(nullptr);
}


More information about the Gcc-bugs mailing list