c++: Add test for PR c++/93211
authorPatrick Palka <ppalka@redhat.com>
Fri, 3 Apr 2020 15:21:56 +0000 (11:21 -0400)
committerPatrick Palka <ppalka@redhat.com>
Fri, 3 Apr 2020 15:23:51 +0000 (11:23 -0400)
The fix for PR c++/90711 also fixed this PR.

gcc/testsuite/ChangeLog:

PR c++/93211
PR c++/90711
* g++.dg/template/koenig11.C: New test.

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

index cf20783d8a64890e3aa028a43fc70eb61ba856c4..0a08024b277271ce04b4625c080a940dad221f29 100644 (file)
@@ -1,3 +1,9 @@
+2020-04-03  Patrick Palka  <ppalka@redhat.com>
+
+       PR c++/93211
+       PR c++/90711
+       * g++.dg/template/koenig11.C: New test.
+
 2020-04-03  Andre Vieira  <andre.simoesdiasvieira@arm.com>
 
        * gcc.target/arm/mve/intrinsics/mve_vector_float.c: Put -mfpu=auto back.
diff --git a/gcc/testsuite/g++.dg/template/koenig11.C b/gcc/testsuite/g++.dg/template/koenig11.C
new file mode 100644 (file)
index 0000000..d69709b
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/93211
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+void g(T);
+
+template<typename T, decltype(g(T{})) = 0>
+void f() {}
+
+template<typename T, decltype(::g(T{})) = 0>
+void f() {} // { dg-bogus "redefinition" }