[committed] c++: Add test for PR c++/93211

Message ID 20200403153044.1513143-1-ppalka@redhat.com
State New
Headers show
Series
  • [committed] c++: Add test for PR c++/93211
Related show

Commit Message

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/g++.dg/template/koenig11.C | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/template/koenig11.C

-- 
2.26.0.106.g9fadedd637

Patch

diff --git a/gcc/testsuite/g++.dg/template/koenig11.C b/gcc/testsuite/g++.dg/template/koenig11.C
new file mode 100644
index 00000000000..d69709bab59
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/koenig11.C
@@ -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" }