-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingcompilerCompiler work involvedCompiler work involvedfixedSomething works now, yay!Something works now, yay!
Description
Describe the bug
Comparison of std::shared_ptrs fails. See the test case.
Command-line test case
C:\Temp>type repro.cpp
#include<compare>
#include<memory>
int main()
{
std::shared_ptr<const int> p1;
std::shared_ptr<void> p2;
auto cmp = p1 <=> p2;
}
C:\Temp>cl /std:c++20 repro.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.35.32215 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
repro.cpp
C:\opt\VC\include\memory(1778): error C2446: '<=>': no conversion from 'void *' to 'const int *'
C:\opt\VC\include\memory(1778): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
repro.cpp(9): note: see reference to function template instantiation 'std::strong_ordering std::operator <=><const int,void>(const std::shared_ptr<const int> &,const std::shared_ptr<void> &) noexcept'
being compiled
Expected behavior
Successful compilation at least.
Additional notes
This fails as well:
const int *p1;
void *p2;
auto cmp = p1 <=> p2;
But both GCC and Clang compile this successfully!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcompilerCompiler work involvedCompiler work involvedfixedSomething works now, yay!Something works now, yay!