Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/constexpr-tuple2.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 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 } |