This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


I didn't realize my change r270319 had fixed this PR.  So adding the test and
closing the PR.

Tested on x86_64-linux, applying to trunk.

2019-06-20  Marek Polacek  <polacek@redhat.com>

	PR c++/89873
	* g++.dg/cpp1y/noexcept1.C: New test.

diff --git gcc/testsuite/g++.dg/cpp1y/noexcept1.C gcc/testsuite/g++.dg/cpp1y/noexcept1.C
new file mode 100644
index 00000000000..86e46c96148
--- /dev/null
+++ gcc/testsuite/g++.dg/cpp1y/noexcept1.C
@@ -0,0 +1,13 @@
+// PR c++/89873
+// { dg-do compile { target c++14 } }
+
+template <int> bool b;
+
+template <typename> 
+struct C {
+  template <typename> friend int foo() noexcept(b<1>); // { dg-error "not usable in a constant expression|different exception specifier" }
+};
+
+template <typename> int foo() noexcept(b<1>);
+
+auto a = C<int>();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]