Issue 167217
Summary [Clang] Clang sometimes fails to propagate deletion of special member functions from an unnamed `struct`
Labels clang:frontend, diverges-from:gcc, diverges-from:msvc, diverges-from:edg
Assignees
Reporter frederick-vs-ja
    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

```C++
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 (?)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to