aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-complex.C
blob: fbaae5dcd5e051c0349393abd46d0ae4310de43b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Make sure C99 complex works with constexpr
// { dg-options -std=c++0x }

struct complex
{
  typedef float value_type;
  typedef __complex__ float _ComplexT;

  constexpr complex(_ComplexT __z) : _M_value(__z) { }

  constexpr complex(float __r = 0.0f, float __i = 0.0f)
  : _M_value(__r + __i * 1.0fi) { }

private:
  _ComplexT _M_value;
};
constexpr complex c1;