Daily bump.
[gcc.git] / gcc / testsuite / g++.dg / diagnostic / bad-binary-ops2.C
blob627e8a573f100d324d18d4954517af288b555fc3
1 // PR c++/107382
2 // PR c++/107383
3 // { dg-do compile }
4 // { dg-options "-O2 -fexcess-precision=standard" }
6 void
7 foo ()
9   float t[2] = { 1, 2 };
10   int const *s = 0;
11   t[1] / s;     // { dg-error "invalid operands of types 'float' and 'const int\\\*' to binary 'operator/'" }
14 void
15 bar ()
17   float t[2] = { 1, 2 };
18   int const *s[2] = { 0, 0 };
19   t[1] / s[0];  // { dg-error "invalid operands of types 'float' and 'const int\\\*' to binary 'operator/'" }
22 void
23 baz (float a, int* b)
25   a -= b;       // { dg-error "invalid operands of types 'float' and 'int\\\*' to binary 'operator-'" }