[PATCH] D45465: [AST] Fix printing tag decl groups in decl contexts

Joel E. Denny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 14 17:34:47 PDT 2018


jdenny added a comment.

In https://reviews.llvm.org/D45465#1098710, @rsmith wrote:

> Looks good, thanks.


Thanks.

> It strikes me that this will still lead to inconsistencies. For example, I expect this:
> 
>   struct A { struct B *a, *b; struct B *c, *d; };
> 
> 
> ... to print as:
> 
>   struct A {
>     struct B *a, *b;
>     struct B *c;
>     struct B *d;
>   };
> 
> 
> ... where the first two are joined because their type owns a declaration of `struct B`, and the second two are not joined because their type does not own a declaration (it just has a reference to the already-existing declaration of `struct B`). One (somewhat hacky) way to address this would be to compare the starting source locations of a sequence of `DeclaratorDecl`s and group them if it's the same.

While it would be nice to fix that, I'm not as concerned because, AFAICT, that doesn't ever change the semantics.


https://reviews.llvm.org/D45465





More information about the cfe-commits mailing list