This is an archive of the discontinued LLVM Phabricator instance.

Fix printing of C style casts with suppressed specifiers
AbandonedPublic

Authored by nick.sumner on Jan 20 2016, 4:42 AM.

Details

Reviewers
bkramer
rsmith
Summary

Allow C style casts to be printed correctly even when the incoming
PrintingPolicy suppresses specifiers. This can happen, for instance,
when casts occur during the initialization of variables inside a
DeclGroup. Given the code:
void foo() {

int *x = ((void *)0), *y = ((void *)0);

}

The casts are printed as:
int *x = ((void *)0), *y = ((*)0);

Note that the second cast lacks 'void' because specifiers are
suppressed when printing members of the declgroup (after the first).

With the patch, the casts are printed as:
int *x = ((void *)0), *y = ((void *)0);

Diff Detail

Event Timeline

nick.sumner retitled this revision from to Fix printing of C style casts with suppressed specifiers.
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:26 AM