diff mbox series

C++ PATCH to add test for c++/66256

Message ID 20190622155236.GW5989@redhat.com
State New
Headers show
Series C++ PATCH to add test for c++/66256 | expand

Commit Message

Marek Polacek June 22, 2019, 3:52 p.m. UTC
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  <polacek@redhat.com>

	PR c++/66256
	* g++.dg/cpp0x/noexcept54.C: New test.
diff mbox series

Patch

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" }
+};