This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Fix ADL for `make_error_{code,condition}`
ClosedPublic

Authored by ldionne on Sep 30 2022, 2:53 AM.

Details

Reviewers
jwakely
ldionne
Group Reviewers
Restricted Project
Commits
rGef843c827102: [libc++] Fix ADL for `make_error_{code,condition}`
Summary

Implement LWG 3629, by making lookup for make_error_code and
make_error_condition only consider names found by ADL. This is achieved
by adding a block scope using-declaration for a function that will be
found by unqualified lookup, preventing unqualified lookup from
continuing to enclosing scopes (the class scope, then enclosing
namespaces). The function named by the using declaration is not
viable, so overload resolution must select a candidate found by ADL.

This fixes https://github.com/llvm/llvm-project/issues/57614

Diff Detail

Event Timeline

jwakely created this revision.Sep 30 2022, 2:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2022, 2:53 AM
jwakely requested review of this revision.Sep 30 2022, 2:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2022, 2:53 AM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald Transcript
jwakely edited the summary of this revision. (Show Details)Sep 30 2022, 2:54 AM
jwakely edited the summary of this revision. (Show Details)
ldionne commandeered this revision.Sep 30 2022, 6:22 AM
ldionne added a reviewer: jwakely.
ldionne added a subscriber: ldionne.

Thanks a lot for the patch Jonathan. I'll commandeer to fix up a few remaining things, I assume this is okay with you.

ldionne updated this revision to Diff 464249.Sep 30 2022, 6:38 AM

Address C++03 errors, add to LWG issues list and a few other nits. Thanks Jonathan!

I assume this is okay with you.

Absolutely! I can't commit it myself anyway, so you might as well fix what needs fixing and commit. Thanks.

jwakely added a comment.EditedSep 30 2022, 7:30 AM

I've just noticed the summary says "The function names by the using declaration" which should be _named_ not names.

ldionne updated this revision to Diff 464280.Sep 30 2022, 7:50 AM
ldionne edited the summary of this revision. (Show Details)

Update commit message, remove = delete since they are not technically required.

ldionne updated this revision to Diff 464348.Sep 30 2022, 11:59 AM

Please clang-tidy. Always use = delete because Clang supports it even in C++03.

ldionne accepted this revision.Sep 30 2022, 2:23 PM
This revision is now accepted and ready to land.Sep 30 2022, 2:23 PM
This revision was automatically updated to reflect the committed changes.