mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 12:16:06 +00:00

Prior to this, clang would always report ``` compile with '-ffixed-point' to enable fixed point types ``` whenever it sees `_Accum`, `_Fract`, or `_Sat` when fixed point arithmetic is not enabled. This can break existing code that uses these as variable names and doesn't use fixed point arithmetic like in some microsoft headers (https://github.com/llvm/llvm-project/pull/67750#issuecomment-1775264907). Fixed point should not raise this error for these cases, so this removes the error altogether and defaults to the usual error clang gives where it can see these keywords as either unknown types or regular variables.
12 lines
316 B
C
12 lines
316 B
C
// RUN: %clang_cc1 -x c -verify %s
|
|
// RUN: %clang_cc1 -x c -verify %s -ffixed-point -DFIXED_POINT=1
|
|
|
|
int _Accum;
|
|
|
|
#ifdef FIXED_POINT
|
|
// expected-error@4{{cannot combine with previous 'int' declaration specifier}}
|
|
// expected-warning@4{{declaration does not declare anything}}
|
|
#else
|
|
// expected-no-diagnostics
|
|
#endif
|