This is an archive of the discontinued LLVM Phabricator instance.

[Clang][C] Fixed a bug where we reject an _Atomic qualified integer in a switch statment
ClosedPublic

Authored by to268 on Sep 15 2023, 9:21 AM.

Details

Summary

We are currently rejecting an _Atomic qualified integer in a switch statment.
This fixes the issue by doing an Lvalue conversion before trying to match on the type.
Fixes #65557

Diff Detail

Event Timeline

to268 created this revision.Sep 15 2023, 9:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 15 2023, 9:21 AM
to268 requested review of this revision.Sep 15 2023, 9:21 AM

Thank you for working on this! You should also add a release note for the fix.

clang/lib/Sema/SemaOverload.cpp
6306–6310

I think this is a slightly cleaner version of what you were doing.

to268 updated this revision to Diff 556868.Sep 15 2023, 10:48 AM

I have added the missing ReleaseNote.

to268 updated this revision to Diff 556871.Sep 15 2023, 11:06 AM
to268 marked an inline comment as done.

Added recommendation by @aaron.ballman

aaron.ballman accepted this revision.Sep 15 2023, 12:13 PM

LGTM (with a tiny nit with the formatting in the release notes), thank you for the fix!

clang/docs/ReleaseNotes.rst
229
This revision is now accepted and ready to land.Sep 15 2023, 12:13 PM
to268 updated this revision to Diff 556892.Sep 16 2023, 1:36 AM
to268 marked an inline comment as done.

I have fixed the ReleaseNote formatting error.
Please land this patch on my behalf "Guillot Tony <tony.guillot@protonmail.com>"

@to268 as discussed, i landed the change on your behalf. Thanks for the patch!