Skip to content

Conversation

zmodem
Copy link
Contributor

@zmodem zmodem commented Aug 27, 2025

In llvm/llvm-project#147835, Clang's AST changed so that a TagType's decl will not necessarily refer to the type's definition, but to the exact declaration which produced the type.

For example, in

typedef struct S T;
struct S {
int x;
};

the 'struct S' type would refer to the incomplete type decl in the typedef, causing CompInfo to fail to see the type's definition.

This patch inserts a call to use the definition when available. It fixes the original test case in
#3275 and most of the test failures caused by the Clang change but not all.

zmodem added 2 commits August 27, 2025 14:12
In llvm/llvm-project#147835, Clang's AST changed
so that a TagType's decl will not necessarily refer to the type's
definition, but to the exact declaration which produced the type.

For example, in

  typedef struct S T;
  struct S {
    int x;
  };

the 'struct S' type would refer to the incomplete type decl in the
typedef, causing CompInfo to fail to see the type's definition.

This patch inserts a call to use the definition when available. It fixes
the original test case in
rust-lang#3275 and most of the
test failures caused by the Clang change but not all.
@zmodem
Copy link
Contributor Author

zmodem commented Aug 27, 2025

r? @emilio

Please take a look!

Copy link
Contributor

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, pushing it a bit further down fixes #3264 too. So I'll land it with a small follow-up tweak (plus the formatting commit squashed).

@emilio
Copy link
Contributor

emilio commented Aug 27, 2025

Thanks a lot for the fix! Included with the squash in #3278

@emilio emilio closed this Aug 27, 2025
emilio added a commit that referenced this pull request Aug 27, 2025
github-merge-queue bot pushed a commit that referenced this pull request Aug 27, 2025
@zmodem
Copy link
Contributor Author

zmodem commented Aug 27, 2025

Nice! Thanks for jumping on this :-)

emilio added a commit that referenced this pull request Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants