]> gcc.gnu.org Git - gcc.git/blame - gcc/testsuite/g++.dg/cpp0x/constexpr-fwctor1.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-fwctor1.C
CommitLineData
acb2970c
JM
1// PR c++/66450
2// { dg-do compile { target c++11 } }
3
4struct foo {
5 constexpr foo(int a);
6 constexpr foo(int a, int b, int c): a{a}, b{b}, c{c} {}
7
8 int a, b, c;
9};
10
11constexpr foo make_foo(int a) { return foo{a, a+1, a+2}; }
12constexpr foo::foo(int a): foo{make_foo(a)} {}
13
14int main() {
15 constexpr const foo f{3};
16 static_assert(f.a == 3, "");
17 static_assert(f.b == 4, "");
18 static_assert(f.c == 5, "");
19}
This page took 3.568281 seconds and 5 git commands to generate.