Debian Codegraph @

gcc/testsuite/g++.dg/other/warning1.C

raw
1 // { dg-do compile }
2
3 // PR c++/7804
4 // Floating point formatting in error and warning messages
5
6 extern "C" int printf(const char *, ...);
7
8 struct S
9 {
10 static const float inf = 1.0f / 0.0f; // { dg-error "1.0|float|initializ" }
11 static const float nan = 0.0f / 0.0f; // { dg-error "0.0|float|initializ" }
12 };
13
14 int main()
15 {
16 // { dg-prune-output "not a member" }
17 printf("%f\n%f\n", S::inf, S::nan);
18 return 0;
19 }