[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / g++.dg / lookup / exception1.C
blob60c223fd53bfc130cf6ff3e0e0ab71a98f10daa3
1 /* PR 2743 */
2 /* { dg-do compile } */
4 namespace ns {
5   class Exception
6   {
7   };
10 namespace ns
12   class Test {
13     public:
14       inline Test()
15 #if __cplusplus <= 201402L
16       throw( Exception )                        // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
17 #endif
18       ;
19       inline Test(int n )
20 #if __cplusplus <= 201402L
21       throw( Exception )                        // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
22 #endif
23       ;
24     private:
25       int i;
26   };
29 // This line used to fail because Exception wasn't looked up in the
30 // right scope.
31 ns::Test::Test()
32 #if __cplusplus <= 201402L
33 throw( Exception )                              // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
34 #endif
35 : i( 1 )
39 ns::Test::Test( int n )
40 #if __cplusplus <= 201402L
41 throw( Exception )                              // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
42 #endif
43 : i( n )
47 int main(int argc, char* argv[]) {
48   ns::Test test;