Debian Codegraph @

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

raw
1 // PR c++/58910
2 // { dg-do compile { target c++11 } }
3
4 #include <tuple>
5
6 using namespace std;
7 struct t1{ constexpr t1(){} };
8 struct t2{ constexpr t2(){} };
9
10 int main()
11 {
12 constexpr t1 T1;
13 constexpr t2 T2;
14 constexpr tuple<t1,t2> Tup1(T1,T2);
15 constexpr tuple<t1,t1> Tup2(T1,T1);
16 constexpr auto a=get<0>(Tup1 ); //works fine
17 constexpr auto b=get<0>(Tup2 ); // error:
18 //'(const std::_Head_base<0ul, t1, true>*)(& Tup2)'
19 //is not a constant expression constexpr auto b=get<0>(Tup2 );
20 }