Now that the parsing of noexcept-specifiers is properly delayed, this test gives the error it should.
Tested x86_64-linux, applying ot trunk. 2019-06-22 Marek Polacek <pola...@redhat.com> PR c++/66256 * g++.dg/cpp0x/noexcept54.C: New test. diff --git gcc/testsuite/g++.dg/cpp0x/noexcept54.C gcc/testsuite/g++.dg/cpp0x/noexcept54.C new file mode 100644 index 00000000000..20d844b8e89 --- /dev/null +++ gcc/testsuite/g++.dg/cpp0x/noexcept54.C @@ -0,0 +1,10 @@ +// PR c++/66256 - noexcept-specifier is a complete-class context. +// { dg-do compile { target c++11 } } + +void swap(int&, int&); + +int& get(); + +struct pair { + void swap(pair&) noexcept(noexcept(swap(get(), get()))) { } // { dg-error "no matching function for call" } +};