summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/inherit4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/inherit4.C')
-rw-r--r--gcc/testsuite/g++.dg/template/inherit4.C14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/inherit4.C b/gcc/testsuite/g++.dg/template/inherit4.C
new file mode 100644
index 000000000..511c9e605
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/inherit4.C
@@ -0,0 +1,14 @@
+// PR c++/21008, DR 515
+
+struct A {
+ int foo_;
+};
+template <typename T> struct B: public A { };
+template <typename T> struct C: B<T> {
+ int foo() {
+ return A::foo_; // #1
+ }
+};
+int f(C<int>* p) {
+ return p->foo();
+}