This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Check whether `__auto_type` has been deduced before merging
ClosedPublic

Authored by ahatanak on Jun 22 2022, 12:34 PM.

Details

Summary

This fixes a bug in clang where it emits the following diagnostic when compiling the test case:

argument to 'sizeof' in 'memset' call is the same pointer type 'S' as the destination

The code that merges __auto_type with other types was committed in https://reviews.llvm.org/D122029.

Diff Detail

Event Timeline

ahatanak created this revision.Jun 22 2022, 12:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2022, 12:34 PM
ahatanak requested review of this revision.Jun 22 2022, 12:34 PM
aaron.ballman accepted this revision.Jun 23 2022, 11:10 AM

Oh, great catch! Thank you for the fix. The changes here LGTM, but precommit CI failed because of patch application. That issue was resolved on the precommit CI machine, so it might not be a bad idea to push up a rebased version of this patch to run precommit CI before landing just to be sure there aren't surprises, or be sure to land it when you're around to react to build failures if any do crop up.

This revision is now accepted and ready to land.Jun 23 2022, 11:10 AM
ahatanak updated this revision to Diff 439636.Jun 23 2022, 11:49 PM

Change the type of memset's length parameter to silence warnings on windows.

This revision was landed with ongoing or failed builds.Jun 24 2022, 9:50 AM
This revision was automatically updated to reflect the committed changes.