diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/template/typedef20.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/template/typedef20.C | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/typedef20.C b/gcc-4.9/gcc/testsuite/g++.dg/template/typedef20.C new file mode 100644 index 000000000..c768ce0a7 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/template/typedef20.C @@ -0,0 +1,27 @@ +// Contributed by Dodji Seketeli <dodji@redhat.com> +// Origin PR c++/40007 +// { dg-do compile } + +class x +{ + typedef int privtype; // { dg-error "is private" } + +protected: + typedef int type; +}; + +template<typename T> +struct y : public x +{ + typename x::type z; +}; + +template<typename T> +struct y<T*> : public x +{ + typedef x::type good; + typedef x::privtype bad; // { dg-error "within this context" } +}; + +template class y<int>; +template class y<int*>; |