r332314 - [AST] Fix printing tag decl groups in decl contexts

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Wed May 16 01:05:50 PDT 2018


On Tue, May 15, 2018 at 7:30 PM, Joel E. Denny <jdenny.ornl at gmail.com> wrote:
> Hi Hans,
>
> On Tue, May 15, 2018 at 6:23 AM, Hans Wennborg <hans at chromium.org> wrote:
>>
>> This broke the ast-print-record-decl.c test on Windows, see for
>> example
>> http://lab.llvm.org:8011/builders/clang-with-thin-lto-windows/builds/9066
>>
>> One way to reproduce the failure on Linux is to pass a Windows triple
>> to this ast-print command:
>>
>> --- a/test/Misc/ast-print-record-decl.c
>> +++ b/test/Misc/ast-print-record-decl.c
>> @@ -54,7 +54,7 @@
>>  //   RUN:        -DKW=struct -DBASES=' : B' -o - -xc++ %s \
>>  //   RUN: | FileCheck --check-prefixes=CHECK,LLVM %s
>>  //
>> -//   RUN: %clang_cc1 -verify -ast-print -DKW=struct -DBASES=' : B' -xc++
>> %s \
>> +//   RUN: %clang_cc1 -verify -triple i686-pc-win32 -ast-print
>> -DKW=struct -DBASES=' : B' -xc++ %s \
>>  //   RUN: > %t.cpp
>>  //   RUN: FileCheck --check-prefixes=CHECK,PRINT,PRINT-CXX -DKW=struct \
>>  //   RUN:           -DBASES=' : B' %s --input-file %t.cpp
>>
>> What's happening is that on Windows, "__single_inheritance(1)" is
>> printed before T1. But if I change the test to allow that in the
>> output, it still doesn't pass as Clang doesn't seem able to parse it.
>
>
> The underlying bug is present at least as far back as 4.0.1.  The bug is
> revealed by an earlier patch, r332281, simply because it introduces this
> test.
>
> There are two parts to this bug.  First, implicit attributes shouldn't print
> as that's not faithful to the original source.  I'm addressing that at
>
> https://reviews.llvm.org/D46894
>
> Second, when this attribute is explicit, the "(1)" shouldn't print as it's
> not part of the accepted syntax.  I'll address that in another patch.

Great! Thanks for digging into this and fixing.


More information about the cfe-commits mailing list