[cfe-dev] __declspec(dllimport) strangeness

Eric Niebler eric at boostpro.com
Thu Dec 2 10:11:43 PST 2010


In testing the AST I came across a strangeness in how the DLLImport
attribute is handled. The following code results in a warning:

void __declspec(dllimport) foo12();
void foo12(){}

The warning is:
'foo12' redeclared without dllimport attribute: previous dllimport ignored

However, the AST for foo12 still has the DLLImport attribute. This seems
wrong to me. At least, it isn't what the warning is suggesting.

The warning is issued in Sema::ActOnStartOfFunctionDef (search for
warn_redeclaration_without_attribute_prev_attribute_ignored). Should the
attribute be removed when the diagnostic is issued?

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com



More information about the cfe-dev mailing list