Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/constexpr-using.C

raw
1 // Core issue 898
2 // { dg-do compile { target c++11 } }
3
4 namespace N { const int i = 42; }
5 namespace M { const int j = 42; }
6
7 constexpr int g() {
8 using namespace N;
9 using M::j;
10 static_assert (i == 42, "i == 42");
11 return i + j;
12 }
13
14 template <class T>
15 constexpr int h() {
16 using namespace N;
17 using M::j;
18 static_assert (i == 42, "i == 42");
19 return i + j;
20 }
21
22 constexpr int i = g();
23 constexpr int i2 = h<int>();
24
25 static_assert (i == 84, "i == 84");
26 static_assert (i2 == 84, "i2 == 84");
27