diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/lookup/template3.C')
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/template3.C | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/lookup/template3.C b/gcc/testsuite/g++.dg/lookup/template3.C new file mode 100644 index 000000000..e5f6f18ed --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/template3.C @@ -0,0 +1,35 @@ +// Origin PR c++/47957 +// { dg-do compile } + +struct S +{ + int m; + + S() + : m(0) + { + } +}; + +struct Base +{ + typedef S T; +}; + +template<class T> +struct Derived : public Base +{ + int + foo() + { + T a; // This is Base::T, not the template parameter. + return a.m; + } +}; + +int +main() +{ + Derived<char> d; + return d.foo(); +} |