-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"diverges-from:edgDoes the clang frontend diverge from edg compiler on this issueDoes the clang frontend diverge from edg compiler on this issuediverges-from:gccDoes the clang frontend diverge from gcc on this issueDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issueDoes the clang frontend diverge from msvc on this issue
Description
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<class T>
struct WrapperTmpl {
struct {
NonMovable v;
};
};
using Wrapper2 = WrapperTmpl<NonMovable>;
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 (?)Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"diverges-from:edgDoes the clang frontend diverge from edg compiler on this issueDoes the clang frontend diverge from edg compiler on this issuediverges-from:gccDoes the clang frontend diverge from gcc on this issueDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issueDoes the clang frontend diverge from msvc on this issue