[clang] [Clang] Allow simpler visibility annotations when targeting win32 and mingw (PR #133699)

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 26 01:17:32 PDT 2025


mstorsjo wrote:

> > It may also be possible to just ignore the extra warnings with GCC with some extra flags about ignored attributes though.
> 
> Exactly. We already do this in lots of cases.

This relies on the assumption that the extra attribute in the unexpected location simply produces a warning, not a hard error without a way to disable it.

There _are_ such cases where things that may be a plain warning with Clang is a hard error with GCC - I recently ran into one. But in this case it does indeed seem like the extra attributes are plain warnings with all of Clang, GCC and MSVC. Using the example from above:

```c++
```

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


More information about the cfe-commits mailing list