This is an archive of the discontinued LLVM Phabricator instance.

Fix printing of nested variable declarations with suppressed specifiers
AbandonedPublic

Authored by nick.sumner on Jan 21 2016, 3:04 PM.

Details

Reviewers
bkramer
rsmith
Summary

Allow nested variable declarations to have their types printed correctly even
when the incoming PrintingPolicy suppresses specifiers. This can happen when
initializing a variable with a statement expression. Given the C code:

int a, b = ({
    int c = 1;
    c;
});

The declaration of c is printed with a missing type specifier:

int a, b = ({
    c = 1;
    c;
});

With the patch, the declaration of c is properly printed:

int a, b = ({
    int c = 1;
    c;
});

This is related to the previous patch: http://reviews.llvm.org/D16352

Diff Detail

Event Timeline

nick.sumner retitled this revision from to Fix printing of nested variable declarations 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:28 AM