Skip to content
Commit 9359b8fe authored by Steven Watanabe's avatar Steven Watanabe
Browse files

Fix printing of anonymous struct typedefs.

clang -cc1 -ast-print put the struct
definition in the wrong place, like this:

  struct {} typedef S;

The reason that this happens is that the printing code
first prints the struct definition, and then tells the next
declaration to leave out the type. This behavior
is correct for simple variable declarations, but fails for
typedefs (or extern, mutable, etc).

The patch address this problem by skipping the struct
declaration when we first see it, and then telling the first
subsequent declaration that it needs to print out the full
struct definition.

Differential Revision: http://reviews.llvm.org/D17285

llvm-svn: 263836
parent 26628d30
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment