This is an archive of the discontinued LLVM Phabricator instance.

PR8901: attribute "mode" rejected for enums and dependent types
ClosedPublic

Authored by d.zobnin.bugzilla on Jan 15 2016, 6:54 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

d.zobnin.bugzilla retitled this revision from to PR8901: attribute "mode" rejected for enums and dependent types.
d.zobnin.bugzilla updated this object.
d.zobnin.bugzilla added a subscriber: cfe-commits.

Updated the patch after committed fix for http://reviews.llvm.org/D16301 (r258213).

This patch:

  1. Adds "Enum" Subject to 'mode' attribute to be able to compile code like "typedef enum { X } attribute((mode(QI))) T;"
  2. Moves handling of the attribute to a new Sema's method in order to support 'mode' attribute on dependent types;
  3. Adds several cases to the tests (both for templates and non-dependent types).

Please take a look.

Friendly ping, please take a look.

aaron.ballman accepted this revision.Jan 27 2016, 6:35 AM
aaron.ballman edited edge metadata.

Aside from one nitpick about the diagnostic wording, this LGTM.

include/clang/Basic/Attr.td
882 ↗(On Diff #45401)

One of these days I may have to come up with a more general solution for this sort of subject list. :-(

include/clang/Basic/DiagnosticSemaKinds.td
2856 ↗(On Diff #45401)

s/enumeral/enumeration

This revision is now accepted and ready to land.Jan 27 2016, 6:35 AM
d.zobnin.bugzilla edited edge metadata.

Thanks for the review!

Only updated the text of diagnostics, NFC.

This revision was automatically updated to reflect the committed changes.