| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
// { dg-options "-pedantic" } |
| 3 |
|
| 4 |
namespace ns { typedef int T; } |
| 5 |
|
| 6 |
constexpr int Test1(int x) { using ns::T; typedef T U; return U(x); } |
| 7 |
constexpr int Test2(int x) { using namespace ns; typedef T U; return U(x); } |
| 8 |
constexpr int Test3(int x) { { using ns::T; typedef T U; return U(x); } } // { dg-warning "compound-statement" "" { target { c++11_only } } } |
| 9 |
constexpr int Test4(int x) { { using namespace ns; typedef T U; return T(x); } } // { dg-warning "compound-statement" "" { target { c++11_only } } } |
| 10 |
|
| 11 |
struct S1 |
| 12 |
{ |
| 13 |
constexpr S1() { using ns::T; typedef T U; } |
| 14 |
}; |
| 15 |
|
| 16 |
struct S2 |
| 17 |
{ |
| 18 |
constexpr S2() { using namespace ns; typedef T U; } |
| 19 |
}; |
| 20 |
|
| 21 |
struct S3 |
| 22 |
{ |
| 23 |
constexpr S3() { { using ns::T; typedef T U; } } // { dg-warning "compound-statement" "" { target { c++11_only } } } |
| 24 |
}; |
| 25 |
|
| 26 |
struct S4 |
| 27 |
{ |
| 28 |
constexpr S4() { { using namespace ns; typedef T U; } } // { dg-warning "compound-statement" "" { target { c++11_only } } } |
| 29 |
}; |