summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/hidden-class16.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/lookup/hidden-class16.C')
-rw-r--r--gcc/testsuite/g++.dg/lookup/hidden-class16.C27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/lookup/hidden-class16.C b/gcc/testsuite/g++.dg/lookup/hidden-class16.C
new file mode 100644
index 000000000..25cc40294
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/hidden-class16.C
@@ -0,0 +1,27 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR c++/36019
+// { dg-do compile }
+
+struct F {
+ static const int y = 0;
+};
+
+struct A {
+ static const int x = 0;
+};
+
+struct B : public A {
+ template <typename A>
+ static int f ()
+ {
+ return A::x; // { dg-error "'x' is not a member of 'F'" }
+ }
+};
+
+int
+main ()
+{
+ int j = B::f<F> ();
+ return 0;
+}
+