Skip to content
Snippets Groups Projects
  • Steven Watanabe's avatar
    7d8134a1
    Fix printing of anonymous struct typedefs. · 7d8134a1
    Steven Watanabe authored
    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
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263836 91177308-0d34-0410-b5e6-96231b3b80d8
    7d8134a1
    History
    Fix printing of anonymous struct typedefs.
    Steven Watanabe authored
    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
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263836 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.