This is an archive of the discontinued LLVM Phabricator instance.

[clang][parse] Remove dead ProhibitAttributes() call
ClosedPublic

Authored by tbaeder on Feb 23 2021, 4:29 AM.

Details

Summary

Since MaybeParseGNUAttributes() only takes a ParsedAttributes and not a ParsedAttributesWithRange, the source range of attrs will always be invalid after calling MaybeParseGNUAttributes(). That means the call to ProhibitAttributes() removed in this patch will always simply do nothing.

The comment that's removed alongside the ProhibitAttributes() call seems to be incorrect as well since numerous tests use (and expect) GNU-style attributes in enum bodies.

Diff Detail

Event Timeline

tbaeder requested review of this revision.Feb 23 2021, 4:29 AM
tbaeder created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2021, 4:29 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaron.ballman accepted this revision.Feb 23 2021, 4:51 AM

I did some digging and GCC used to reject attributes in this position but started accepting them in GCC 6, so this is the correct change. Thanks for catching it! LGTM

This revision is now accepted and ready to land.Feb 23 2021, 4:51 AM
This revision was landed with ongoing or failed builds.Feb 23 2021, 4:56 AM
This revision was automatically updated to reflect the committed changes.