Skip to content

Fix compat with Clang 22#1671

Open
fw-immunant wants to merge 1 commit intomasterfrom
fw/clang-22
Open

Fix compat with Clang 22#1671
fw-immunant wants to merge 1 commit intomasterfrom
fw/clang-22

Conversation

@fw-immunant
Copy link
Contributor

No description provided.

Clang 22 removes `ElaboratedType` and now represents `size_t`/`ssize_t`/`ptrdiff_t` using `PredefinedSugarType` (see llvm PR #143653)
@fw-immunant fw-immunant marked this pull request as ready for review March 17, 2026 20:41
Comment on lines -2227 to -2228
auto t = D->getTypeForDecl();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are unused and the getTypeForDecl method no longer exists in Clang 22.

.expect("Predefined sugar type kind not found");

// See `clang::PredefinedSugarKind`.
let predef_sugar_ty = match kind {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this affect the portable type code?

Copy link
Contributor

Choose a reason for hiding this comment

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

PredefinedSugarKind seems to be similar to what we're doing with the portable types, but just for size_t, ssize_t, and ptrdiff_t, so I'm wondering if we need to handle this specially.

VisitQualType(t);
}

#if CLANG_VERSION_MAJOR < 22
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we indent preprocessor directives? In most projects, they start at column 1.

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.

3 participants