[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

Sean McBride via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 28 08:06:37 PDT 2025


seanm wrote:

Should this warn about `wchar_t` in C?

```c
#include <wchar.h>

int main (void)
{
  wchar_t foo;
  (void)foo;
  return 0;
}
```

```
% xcrun /Users/builder/llvm/llvm-install/bin/clang -fsyntax-only -Weverything ~/Desktop/test.c

/Users/builder/Desktop/test.c:5:3: warning: identifier 'wchar_t' conflicts with a C++ keyword [-Wc++-keyword]
    5 |   wchar_t foo;
      |   ^
```


https://github.com/llvm/llvm-project/pull/137234


More information about the cfe-commits mailing list