This is an archive of the discontinued LLVM Phabricator instance.

Fix aggregate CTAD with string literals adding extra const
ClosedPublic

Authored by MitalAshok on Jul 2 2023, 8:24 AM.

Details

Summary

Missing a withConst, so when deducing from a string literal, a const is erroneously added to the deduced type.

Diff Detail

Event Timeline

MitalAshok created this revision.Jul 2 2023, 8:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2023, 8:24 AM
MitalAshok edited the summary of this revision. (Show Details)Jul 2 2023, 8:30 AM
MitalAshok retitled this revision from Fix CTAD with string literals adding extra const to Fix aggregate CTAD with string literals adding extra const.
MitalAshok added a subscriber: cfe-commits.
MitalAshok added inline comments.
clang/lib/Sema/SemaInit.cpp
10707

The "const-qualified" here was missing

MitalAshok published this revision for review.Jul 2 2023, 8:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2023, 8:32 AM
ychen added a comment.Jul 2 2023, 11:08 AM

Thanks for catching this. The change LGTM. I think this is https://wg21.link/cwg2681. Could you please move the test to clang/test/CXX/drs/dr26xx.cpp and keep only these tests that are in the DR? Then you could run clang/www/make_cxx_dr_status to update clang/www/cxx_dr_status.html.

ychen added a comment.Jul 2 2023, 11:09 AM

clang/test/SemaTemplate/aggregate-deduction-candidate.cpp seems need updates.

MitalAshok updated this revision to Diff 536648.Jul 2 2023, 7:53 PM
MitalAshok edited the summary of this revision. (Show Details)

Add status for CWG2681 and fixed aggregate-deduction-candidate test

ychen accepted this revision.Jul 2 2023, 8:24 PM

LGTM. Thank you!

This revision is now accepted and ready to land.Jul 2 2023, 8:24 PM
This revision was landed with ongoing or failed builds.Jul 5 2023, 11:56 AM
This revision was automatically updated to reflect the committed changes.