aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/warning1.C
blob: 109fc46aa22b2c2c18e0f8149b7e0ebb03d9feee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// { dg-do compile }

// PR c++/7804
// Floating point formatting in error and warning messages

extern "C" int printf(const char *, ...);

struct S
{
  static const float inf = 1.0f / 0.0f; // { dg-warning "1.0|initialization" }
  static const float nan = 0.0f / 0.0f; // { dg-warning "0.0|initialization" }
};

int main()
{
  printf("%f\n%f\n", S::inf, S::nan);
  return 0;
}