Debian Codegraph @

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

raw
1 // Make sure C99 complex works with constexpr
2 // { dg-do compile { target c++11 } }
3 // { dg-options "" }
4
5 struct complex
6 {
7 typedef float value_type;
8 typedef __complex__ float _ComplexT;
9
10 constexpr complex(_ComplexT __z) : _M_value(__z) { }
11
12 constexpr complex(float __r = 0.0f, float __i = 0.0f)
13 : _M_value(__r + __i * 1.0fi) { }
14
15 private:
16 _ComplexT _M_value;
17 };
18 constexpr complex c1;