Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg3.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/49988 |
2 // { dg-do run { target c++11 } } | |
3 | |
4 template<int ... I> struct X { }; | |
5 | |
6 struct A { | |
7 char data[3]; | |
8 template<int ... I> | |
9 constexpr | |
10 A(const char (&s)[3], X<I...> x) : data{ s[I]...} { } | |
11 }; | |
12 struct B { | |
13 A a; | |
14 B(const char (&s)[3]) : a{s,X<0,1,2>{}} { } | |
15 }; | |
16 | |
17 int main() | |
18 { | |
19 B b{"12"}; | |
20 if (b.a.data[0] != '1') | |
21 return 1; | |
22 } |