diff mbox series

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

Message ID 20190620122353.GD5989@redhat.com
State New
Headers show
Series C++ PATCH to add test for c++/89873 | expand

Commit Message

Marek Polacek June 20, 2019, 12:23 p.m. UTC
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 mbox series

Patch

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>();