re PR c++/66256 (noexcept evaluation done before end of class)
authorMarek Polacek <polacek@redhat.com>
Sat, 22 Jun 2019 15:51:49 +0000 (15:51 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Sat, 22 Jun 2019 15:51:49 +0000 (15:51 +0000)
PR c++/66256
* g++.dg/cpp0x/noexcept54.C: New test.

From-SVN: r272588

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/noexcept54.C [new file with mode: 0644]

index 0b122c6075de6c349a4b633a335da6ca18646efa..d1226e6c3701e459a2b1220e0a6842f516512bd9 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-22  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/66256
+       * g++.dg/cpp0x/noexcept54.C: New test.
+
 2019-06-22  Jan Hubicka  <jh@suse.cz>
 
        * gcc.dg/tree-ssa/alias-access-path-6.c: New testcase.
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept54.C b/gcc/testsuite/g++.dg/cpp0x/noexcept54.C
new file mode 100644 (file)
index 0000000..20d844b
--- /dev/null
@@ -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" }
+};