Skip to content

Implement LWG-3629 make_error_code and make_error_condition are customization points - #3272

Merged
Stephan T. Lavavej (StephanTLavavej) merged 5 commits into
microsoft:mainfrom
frederick-vs-ja:lwg-3629
Dec 15, 2022
Merged

Stephan T. Lavavej (StephanTLavavej) merged 5 commits into
microsoft:mainfrom
frederick-vs-ja:lwg-3629

Conversation

@frederick-vs-ja

@frederick-vs-ja A. Jiang (frederick-vs-ja) commented Dec 7, 2022

Copy link
Copy Markdown
Contributor

Fixes #3216.

Also adding _STD-qualifications to calls in <future> and <xiosbase>, because these calls always find overloads declared in std:: and it is unnecessary to enable ADL for them.

Some previously accepted codes will be rejected after these changes. Unfortunately, I don't know how to examine such cases in tests, because only hard errors would occur.

@frederick-vs-ja
A. Jiang (frederick-vs-ja) requested a review from a team as a code owner December 7, 2022 17:13
- make sure invocations for `std::` overloads
- drop `std::` for types
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the LWG Library Working Group issue label Dec 7, 2022
Comment thread tests/std/tests/Dev11_0493504_error_category_lifetime/test.cpp Outdated
Comment thread stl/inc/system_error
Comment thread tests/std/tests/Dev11_0493504_error_category_lifetime/test.cpp Outdated
@StephanTLavavej

Copy link
Copy Markdown
Member

Looks great! I pushed a couple of trivial changes. Thanks for adding the _STD qualifications, this makes more sense than our previous system of not qualifying these calls (and not even commenting why).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicky, non-functional changes. I'll push a change to address my comments.

Comment thread stl/inc/system_error

namespace _Ensure_adl {
void make_error_code() = delete;
void make_error_condition() = delete;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For other reviewers: this change doesn't need to workaround the MSVC bug that was an issue for the CPOs (#3215 (comment)), that bug only affects names in requires-expressions. (No change requested.)

Comment thread stl/inc/system_error Outdated
Comment thread tests/std/tests/Dev11_0493504_error_category_lifetime/test.cpp Outdated
@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit d8ef034 into microsoft:main Dec 15, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks again for implementing this LWG issue resolution! 🎉 📈 🐱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LWG Library Working Group issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LWG-3629 make_error_code and make_error_condition are customization points

3 participants