diff mbox series

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

Message ID 20190213163811.GU3884@redhat.com
State New
Headers show
Series C++ PATCH to add test for c++/77304 | expand

Commit Message

Marek Polacek Feb. 13, 2019, 4:38 p.m. UTC
Tested x86_64-linux, checking in as obvious.

2019-02-13  Marek Polacek  <polacek@redhat.com>

	PR c++/77304
	* g++.dg/cpp2a/nontype-class13.C: New test.
diff mbox series

Patch

diff --git gcc/testsuite/g++.dg/cpp2a/nontype-class13.C gcc/testsuite/g++.dg/cpp2a/nontype-class13.C
new file mode 100644
index 00000000000..14c601ba040
--- /dev/null
+++ gcc/testsuite/g++.dg/cpp2a/nontype-class13.C
@@ -0,0 +1,21 @@ 
+// PR c++/77304
+// { dg-do compile { target c++2a } }
+
+struct S {};
+
+template < typename T > struct A
+{
+  template < S > void f () {}
+
+  static void * g ()
+  {
+    return (void *) f < a >; // { dg-error "invalid" }
+  }
+
+  static S a;
+};
+
+void * f ()
+{
+  return A < int >::g ();
+}