summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-complex.C
blob: 0d4ea010cb372d03f4e11a4ba1cd6ea0d3583740 (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=gnu++11 }

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;
OpenPOWER on IntegriCloud