summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/complex3.C
blob: 062c2d44bed7c356784184ffaeb812524615bf6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// PR c++/31780
// { dg-do run }
// { dg-options "" }

// Test that we can implicitly convert to _Complex, but that it's worse
// than a scalar arithmetic conversion.

extern "C" void exit (int);

int r = 0;

void f (_Complex int) { ++r; }
void f (double) { }

void g (_Complex int) { }

int main()
{
  f (1);
  g (1);

  return r;
}

void bar()
{
  r ? 0i : 0;
}