diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/other/warning1.C')
-rw-r--r-- | gcc/testsuite/g++.dg/other/warning1.C | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/warning1.C b/gcc/testsuite/g++.dg/other/warning1.C new file mode 100644 index 000000000..77653a1df --- /dev/null +++ b/gcc/testsuite/g++.dg/other/warning1.C @@ -0,0 +1,19 @@ +// { 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|float|initialization" } + static const float nan = 0.0f / 0.0f; // { dg-warning "0.0|float|initialization" } +}; + +int main() +{ + // { dg-prune-output "not a member" } + printf("%f\n%f\n", S::inf, S::nan); + return 0; +} |