aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-complex.C
blob: fa393484d6c378c0407bc51ceda9f26abb70c122 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Make sure C99 complex works with constexpr
// { dg-do compile { target c++11 } }
// { dg-options "" }

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;