-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
This well-formed program fails to compile with MSVC STL due to unqualified calls to internal functions (which trigger ADL and overly require completeness of related types).
#include <any>
#include <concepts>
#include <functional>
#include <memory>
#include <optional>
#include <variant>
struct Incomplete;
template<class T>
struct Holder {
T t;
};
using Ptr = Holder<Incomplete>*;
int main()
{
std::make_shared<Ptr>();
std::make_shared<Ptr[]>(42);
std::function<void(Ptr)>{std::identity{}};
std::any{Ptr{}};
std::optional<Ptr>{}.emplace();
std::variant<Ptr>{}.emplace<Ptr>();
}Godbolt link. (libc++ accepts it correctly)
This is similar to #1596 but touches different library mechanisms, and should be considered as a sub-issue of #140.
Previously, 3 libc++ tests were blocked by this issue:
std/utilities/function.objects/func.wrap/func.wrap.func/robust_against_adl.pass.cppstd/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cppstd/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp
Perhaps we should _STD-qualify internal function calls used for in-place construction/destruction by default, especially for _Construct_in_place, _Destroy_in_place, and (_Voidify_iter_Voidify_iter was killed when implementing LWG-3870).
- Issues of
variantare fixed by_STD-qualify_Uglynon-member function calls in<variant>#3148. - Issues of
anyare fixed by Bugfixes for<any>#3965. - Issues of
allocatorare fixed by Properly destroyvector<shared_ptr<uninstantiable>>#4373. - Issues of
shared_ptrare fixed by<memory>: ADL-proof implementation ofshared_ptrcreation functions and atomic smart pointers #4403. - Issues of
function, etc. are fixed by ADL-proof implementation offunction,move_only_function,packaged_task,promise, andoptional#4430. - Issues of
valarrayare fixed by<valarray>: MakevalarrayADL-proof as required #5157.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working