]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Find make_error_code and make_error_condition via ADL only
authorJonathan Wakely <jwakely@redhat.com>
Wed, 7 Sep 2022 19:17:04 +0000 (20:17 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 8 Sep 2022 18:29:12 +0000 (19:29 +0100)
commitd3883dc77b1426984c0edea6081f57ed2305c9f2
tree3d9dc9f077efb7680a84a9e9f48f66cfad1e44f4
parent7a6564c9b277d9f93582605758d57457de696deb
libstdc++: Find make_error_code and make_error_condition via ADL only

The new proposed resolution for LWG 3629 says that std::error_code and
std::error_condition should only use ADL to find their customization
points. This means we need to use a poison pill to prevent lookup from
finding overloads in the enclosing namespaces.

We can also remove the forward declarations of std::make_error_code and
std::make_error_condition, because they aren't needed now. ADL can find
them anyway (when std is an associated namespace), and unqualified name
lookup will not (and should not) find them.

libstdc++-v3/ChangeLog:

* include/std/system_error (__adl_only::make_error_code): Add
deleted function.
(__adl_only::make_error_condition): Likewise.
(error_code::error_code(ErrorCodeEnum)): Add using-declaration
for deleted function.
(error_condition::error_condition(ErrorConditionEnum)):
Likewise.
* testsuite/19_diagnostics/error_code/cons/lwg3629.cc: New test.
* testsuite/19_diagnostics/error_condition/cons/lwg3629.cc: New test.
libstdc++-v3/include/std/system_error
libstdc++-v3/testsuite/19_diagnostics/error_code/cons/lwg3629.cc [new file with mode: 0644]
libstdc++-v3/testsuite/19_diagnostics/error_condition/cons/lwg3629.cc [new file with mode: 0644]