From ab2c347c358036f017003ab7c1043705c6482a8c Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 18 Jun 2019 21:50:51 +0000 Subject: [PATCH] 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 --- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/g++.dg/cpp0x/noexcept42.C | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/noexcept42.C 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; +} -- 2.30.2