]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/89873
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 20 Jun 2019 12:22:25 +0000 (12:22 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 20 Jun 2019 12:22:25 +0000 (12:22 +0000)
* g++.dg/cpp1y/noexcept1.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272507 138bc75d-0d04-0410-961f-82ee72b054a4

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

index c91f8ed98a252d12e2ba49719675f7007c1bd0b1..518dada066f164cf205c6be89eb9f6afe579632b 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-20  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/89873
+       * g++.dg/cpp1y/noexcept1.C: New test.
+
 2019-06-20  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/90937
diff --git a/gcc/testsuite/g++.dg/cpp1y/noexcept1.C b/gcc/testsuite/g++.dg/cpp1y/noexcept1.C
new file mode 100644 (file)
index 0000000..86e46c9
--- /dev/null
@@ -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>();