Hello,
something very strange, with clang++ using the outcome-basic
clang++ --version
clang version 15.0.7 (Fedora 15.0.7-2.fc37)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
#include "outcome-basic.hpp"
// A std::unique_ptr deleter that deletes memory allocated via ::operator new.
#if defined(__cpp_sized_deallocation)
class TrivialDeleter {
public:
explicit TrivialDeleter(std::size_t size) : size_(size) {}
void operator()(void* target) const {
::operator delete(target, size_);
}
private:
std::size_t size_;
};
#else // __cpp_sized_deallocation
class TrivialDeleter {
public:
explicit TrivialDeleter(std::size_t) {}
void operator()(void* target) const { ::operator delete(target); }
};
#endif // __cpp_sized_deallocation
int main()
{
TrivialDeleter deleter(4u);
return 0;
}
with error:
lang++ -std=c++17 ll.cc -I/projects/icom/babel/thirdparty/abseil-cpp/
ll.cc:16:5: error: no matching function for call to 'operator delete'
::operator delete(target, size_);
^~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/new:144:6: note: candidate function not viable: no known conversion from 'const std::size_t' (aka 'const unsigned long') to 'const std::nothrow_t' for 2nd argument
void operator delete(void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
^
/usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/new:153:6: note: candidate function not viable: no known conversion from 'const std::size_t' (aka 'const unsigned long') to 'std::align_val_t' for 2nd argument
void operator delete(void*, std::align_val_t)
^
/usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/new:180:13: note: candidate function not viable: no known conversion from 'const std::size_t' (aka 'const unsigned long') to 'void *' for 2nd argument
inline void operator delete (void*, void*) _GLIBCXX_USE_NOEXCEPT { }
^
/usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/new:130:6: note: candidate function not viable: requires 1 argument, but 2 were provided
void operator delete(void*) _GLIBCXX_USE_NOEXCEPT
^
/usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/new:155:6: note: candidate function not viable: requires 3 arguments, but 2 were provided
In godbolt the error appears in clang <16
Hello,
something very strange, with
clang++using the outcome-basicwith error:
In godbolt the error appears in clang <16