From: Marek Polacek Date: Tue, 18 Jun 2019 21:50:51 +0000 (+0000) Subject: re PR c++/84698 (ICE when using noexcept(noexcept()) declaration on global friend... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ab2c347c358036f017003ab7c1043705c6482a8c;p=gcc.git re PR c++/84698 (ICE when using noexcept(noexcept()) declaration on global friend function of template class) PR c++/84698 * g++.dg/cpp0x/noexcept42.C: New test. From-SVN: r272443 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a348251a930..2848d2ceeca 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2019-06-18 Marek Polacek + PR c++/84698 + * g++.dg/cpp0x/noexcept42.C: New test. + PR c++/71548 * g++.dg/cpp0x/variadic177.C: New test. diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept42.C b/gcc/testsuite/g++.dg/cpp0x/noexcept42.C new file mode 100644 index 00000000000..5d7218dd3e0 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept42.C @@ -0,0 +1,21 @@ +// PR c++/84698 +// { dg-do compile { target c++11 } } + +template +struct X { + void swap(X& o) noexcept { } + + template + friend void swap(X& a, X& b) noexcept(noexcept(a.swap(b))); +}; + +template +inline void swap(X& a, X& b) noexcept(noexcept(a.swap(b))) +{ +} + +int +main () +{ + X x; +}