Tested x86_64-linux, checking in as obvious.

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

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

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

Reply via email to