OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
/cp
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
constexpr-non-const-arg3.C
1
// PR c++/49988
2
// { dg-options -std=c++0x }
3
// { dg-do run }
4
5
template<int ... I> struct X { };
6
7
struct A {
8
char data[3];
9
template<int ... I>
10
constexpr
11
A(const char (&s)[3], X<I...> x) : data{ s[I]...} { }
12
};
13
struct B {
14
A a;
15
B(const char (&s)[3]) : a{s,X<0,1,2>{}} { }
16
};
17
18
int main()
19
{
20
B b{"12"};
21
if (b.a.data[0] != '1')
22
return 1;
23
}