This is an archive of the discontinued LLVM Phabricator instance.

[Clang][Sema] Do not try to analyze dependent alignment during -Wcast-align
ClosedPublic

Authored by serge-sans-paille on May 30 2023, 2:18 PM.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2023, 2:18 PM
serge-sans-paille requested review of this revision.May 30 2023, 2:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2023, 2:18 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

The change looks reasonable for me, though I'm not experienced in related code. Have you checked that it fixes the non-reduced original example?

shafik added inline comments.May 31 2023, 12:10 PM
clang/lib/Sema/SemaChecking.cpp
16163

Can't we just use hasDependentAlignment() which basically does this.

I am curious that we don't have to do this check in every location we use getDeclAlign

Take review into account

Have you checked that it fixes the non-reduced original example?

Just did and it passes.

clang/lib/Sema/SemaChecking.cpp
16163

I missed that method, thanks for point it out. I think we should be doing that check in the other reference in SemaChecking.cpp, but I failed to find a reproducer...

erichkeane accepted this revision.Jun 26 2023, 6:04 AM

Needs a release note, else LGTM.

This revision is now accepted and ready to land.Jun 26 2023, 6:04 AM