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

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 14 16:09:28 PDT 2018


rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

Looks good, 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.


https://reviews.llvm.org/D45465





More information about the cfe-commits mailing list