| 1 |
/* Test silencing the numeric constant extension pedwarns. */ |
| 2 |
/* { dg-options "-pedantic-errors" } */ |
| 3 |
/* { dg-additional-options "-std=gnu17" { target c } } */ |
| 4 |
/* { dg-additional-options -fext-numeric-literals { target c++14 } } */ |
| 5 |
|
| 6 |
#pragma GCC diagnostic push |
| 7 |
|
| 8 |
void f() |
| 9 |
{ |
| 10 |
2.0j; /* { dg-error "imaginary" } */ |
| 11 |
1.0dd; /* { dg-error "decimal float" } */ |
| 12 |
1.0d; /* { dg-error "double constant" } */ |
| 13 |
0b0100; /* { dg-error "binary constant" "" { target { ! c++14 } } } */ |
| 14 |
#pragma GCC diagnostic ignored "-Wpedantic" |
| 15 |
2.0j; |
| 16 |
1.0dd; /* { dg-error "decimal floating-point" "" { target { ! dfp } } } */ |
| 17 |
1.0d; |
| 18 |
|
| 19 |
#ifdef __cplusplus |
| 20 |
#pragma GCC diagnostic ignored "-Wc++14-extensions" |
| 21 |
#endif |
| 22 |
0b0100; |
| 23 |
|
| 24 |
1.0K; /* { dg-bogus {fixed-point types not supported in C\+\+} "" { xfail c++ } } */ |
| 25 |
/* { dg-error {fixed-point types not supported for this target} "" { target { c && { ! fixed_point } } } .-1 } */ |
| 26 |
} |