From: Marek Polacek Date: Sat, 8 Jun 2019 12:51:07 +0000 (+0000) Subject: re PR c++/72845 (gcc crashes (ICE) when compiling program with complex noexcept decla... X-Git-Tag: misc/cutover-git~4954 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d7a99bd3345bff1640ad69c7f33a0736f46590f;p=thirdparty%2Fgcc.git re PR c++/72845 (gcc crashes (ICE) when compiling program with complex noexcept declaration) PR c++/72845 * g++.dg/cpp0x/noexcept41.C: New test. From-SVN: r272078 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 372b06bc1af6..72ee262ff808 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-06-08 Marek Polacek + + PR c++/72845 + * g++.dg/cpp0x/noexcept41.C: New test. + 2019-06-08 Prathamesh Kulkarni * gcc.target/aarch64/sve/init_1.c: Remove options diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept41.C b/gcc/testsuite/g++.dg/cpp0x/noexcept41.C new file mode 100644 index 000000000000..4cd3d8d78544 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept41.C @@ -0,0 +1,12 @@ +// PR c++/72845 +// { dg-do compile { target c++11 } } + +template struct g { static const int h = 0; }; +template void declval() { static_assert(!g::h,""); } +template struct a { + template + friend auto f(d &&, c &&) noexcept(declval) -> decltype(declval); // { dg-error "different exception" } +}; +template auto f(d &&, c &&) -> decltype(declval); +struct e {}; +static_assert((e{}, declval>),""); // { dg-error "no context to resolve type" }