This is an archive of the discontinued LLVM Phabricator instance.

Fix printing of enum casts with suppressed tags
AbandonedPublic

Authored by nick.sumner on Jan 21 2016, 5:39 PM.

Details

Reviewers
bkramer
rsmith
Summary

Allow C style casts of enums to be printed correctly when the incoming PrintingPolicy suppresses tags. This can happen, when casts to enums occur during the initialization of an anonymous struct. Given the code:

enum Foo { FOO = 0 };
struct {
    enum Foo foo;
} anon = {(enum Foo)0};

The type of the enum is suppressed when printing the initializer, so the cast is printed as:

} anon = {()0};

With the patch, the initialization is printed as:

} anon = {(enum Foo)0};

Diff Detail

Event Timeline

nick.sumner retitled this revision from to Fix printing of enum casts with suppressed tags.
nick.sumner updated this object.
nick.sumner added reviewers: bkramer, rsmith.
nick.sumner added a subscriber: cfe-commits.
nick.sumner abandoned this revision.Jan 22 2016, 9:25 AM