Files
clang-p2996/clang/test/Sema/complex-inc-dec.c
Aaron Ballman 1e26a251a3 [C2y] Modify diagnostics for complex increment/decrement
Clang implemented WG14 N3259 as an extension, now it's a feature of C2y.
2024-07-02 09:29:23 -04:00

25 lines
1.2 KiB
C

// RUN: %clang_cc1 -verify -pedantic -std=c99 %s
void func(void) {
_Complex float cf;
_Complex double cd;
_Complex long double cld;
++cf; // expected-warning {{'++' on an object of complex type is a C2y extension}}
++cd; // expected-warning {{'++' on an object of complex type is a C2y extension}}
++cld; // expected-warning {{'++' on an object of complex type is a C2y extension}}
--cf; // expected-warning {{'--' on an object of complex type is a C2y extension}}
--cd; // expected-warning {{'--' on an object of complex type is a C2y extension}}
--cld; // expected-warning {{'--' on an object of complex type is a C2y extension}}
cf++; // expected-warning {{'++' on an object of complex type is a C2y extension}}
cd++; // expected-warning {{'++' on an object of complex type is a C2y extension}}
cld++; // expected-warning {{'++' on an object of complex type is a C2y extension}}
cf--; // expected-warning {{'--' on an object of complex type is a C2y extension}}
cd--; // expected-warning {{'--' on an object of complex type is a C2y extension}}
cld--; // expected-warning {{'--' on an object of complex type is a C2y extension}}
}