Using compiler explorer with:
#include <iostream>#include <memory>struct test{ test(int i) { std::cout << "test::test("<<i<<")\n"; } ~test() { std::cout << "~test()\n"; }};template<>void std::destroy_at(test* p) { std::cout<<"std::destroy_at<test>\n"; p->~test();}intmain (){ auto sp = std::make_shared<test>(3); return 33;}
Gives the expected output using C++20 with gcc x86-64 or clang x86-64:
Program returned: 33test::test(3)std::destroy_at<test>~test()
But x64 msvc v19.32 gives:
Program returned: 33test::test(3)~test()
As if the std::destroy_at has no effect here.
Is this conforming behavior, my misunderstanding or a msvc non conformance or misconfiguration?