r205197 - Sema: Check dll attributes on redeclarations

Nico Rieck nico.rieck at gmail.com
Wed Jul 16 07:13:52 PDT 2014


On 14.07.2014 16:33, Alp Toker wrote:
> We just started internal integration testing for 3.5. This commit breaks
> cross-compilation bootstrap builds to Windows from Fedora 20, Ubuntu
> 14.04 and other current distributions, I believe due to a MinGW64 header
> bug that was only fixed upstream in April 2014.
> 
> We'll want to remove setInvalidDecl() and make the diagnostic either (a)
> a DefaultError warning complete with a warning group name or (b) a
> SuppressInSystemHeader error.
> 
> Do you know what the correct recovery is when accepting the invalid
> code? Should we drop or accept the attribute, and does that decision
> change based on whether we're in GCC or MSVC compatibility mode?

GCC's behavior here seems strange. They don't diagnose the case of
adding a dll attribute. If you define a function, then declare it as
imported, the definition will be emitted, but the imported declaration
is used. Which code triggers this diagnostic?

So for GCC-compat the attribute has to be accepted. But I have no idea
whether user code relies on this so I would tend to (a).

-Nico



More information about the cfe-commits mailing list