PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / tc1 / dr161.C
blob49f679a0c1d6cedf7d82c1c0b194cc34f3cd2d84
1 // { dg-do compile }
2 // Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
3 // DR161: Access to protected nested type 
5 namespace N1 {
6   struct A 
7   {
8   protected:
9     typedef int type;
10   };
12   struct B : public A
13   {
14     void test(void)
15     {
16       A::type t;
17     }
19     friend void ftest(void)
20     {
21       A::type t;
22     }
23   };
27 namespace N2 {
28   template <class T>
29   struct A 
30   {
31   protected:
32     typedef int type;
33   };
35   template <class T>
36   struct B : public A<T>
37   {
38     void test(B b)
39     {
40       typename A<T>::type t;
41     }
43     friend void ftest(B b)
44     {
45       typename A<T>::type t;
46     }
47   };
49   template struct B<void>;