[Clang] Clang sometimes fails to propagate deletion of special member functions from an unnamed struct (original) (raw)
Currently, for the following example. Clang doesn't think the copy/move constructors of Wrapper2 (a class template specialization) are deleted, while it (probably correctly) thinks copy/move constructors of Wrapper (a non-template class) are deleted.
Other compilers seemingly correctly propagate the deletion (when unnamed struct is enabled). https://godbolt.org/z/MeqMMGncG
struct NonMovable { NonMovable(const NonMovable&) = delete; };
struct Wrapper { struct { NonMovable v; }; };
static_assert(!__is_constructible(Wrapper, const Wrapper&)); static_assert(!__is_constructible(Wrapper, Wrapper));
template struct WrapperTmpl { struct { NonMovable v; }; };
using Wrapper2 = WrapperTmpl;
static_assert(!__is_constructible(Wrapper2, const Wrapper2&)); // Clang thinks Wrapper2 is copy constructible (?) static_assert(!__is_constructible(Wrapper2, Wrapper2)); // Clang thinks Wrapper2 is move constructible (?)