diff gcc/testsuite/g++.dg/template/lookup12.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/g++.dg/template/lookup12.C	Mon May 25 07:50:57 2020 +0900
@@ -0,0 +1,26 @@
+// PR c++/94799 - member template function lookup fails.
+
+template<typename T> struct B {
+  void foo ();
+  int i;
+};
+
+template<typename T>
+struct D : public B<T> { };
+
+template<typename T>
+void fn (D<T> d)
+{
+  d.template B<T>::foo ();
+  d.template B<T>::i = 42;
+  D<T>().template B<T>::foo ();
+  d.template D<T>::template B<T>::foo ();
+  d.template D<T>::template B<T>::i = 10;
+}
+
+int
+main ()
+{
+  D<int> d;
+  fn(d);
+}