This is an archive of the discontinued LLVM Phabricator instance.

clang-cl: support __cdecl-on-struct anachronism
ClosedPublic

Authored by sberg on Jan 27 2016, 6:32 AM.

Details

Summary

The Microsoft compiler emits

warning C4229: anachronism used : modifiers on data are ignored

for

struct {} __cdecl s;

but ICU's gendict can generate such (and does when building LibreOffice), so accepting this in clang-cl too would be useful.

Diff Detail

Event Timeline

sberg updated this revision to Diff 46130.Jan 27 2016, 6:32 AM
sberg retitled this revision from to clang-cl: support __cdecl-on-struct anachronism.
sberg updated this object.
sberg added a reviewer: rnk.
sberg added a subscriber: cfe-commits.
rnk added inline comments.Jan 27 2016, 8:50 AM
lib/Parse/ParseDeclCXX.cpp
1108–1110

I think this would be clearer as:

// We will diagnose __cdecl on non-function declarations later, so claim that is valid
// after a type specifier.
return getLangOpts().MicrosoftExt;

Unpacking what the fallthrough does is a little tricky.

majnemer added inline comments.
lib/Parse/ParseDeclCXX.cpp
1107

What about __fastcall, etc.

sberg added inline comments.Jan 27 2016, 8:58 AM
lib/Parse/ParseDeclCXX.cpp
1107

To be honest, I have no idea what the full set of keywords is that would need to be taken care of here (so hoped I would get away with just the one I happened to come across ;)

majnemer added inline comments.Jan 27 2016, 9:13 AM
lib/Parse/ParseDeclCXX.cpp
1107
sberg updated this revision to Diff 46228.Jan 27 2016, 11:45 PM

updated as discussed in the comments

sberg added a comment.Mar 2 2016, 5:38 AM

friendly ping

rnk accepted this revision.Mar 2 2016, 7:58 AM
rnk edited edge metadata.

Thanks, lgtm.

This revision is now accepted and ready to land.Mar 2 2016, 7:58 AM
sberg added a comment.Mar 3 2016, 3:24 AM

Can you please push this, I do not have commit access. Thanks

friendly ping

This revision was automatically updated to reflect the committed changes.