Issue |
143245
|
Summary |
MSVC Compatibility: [[msvc::no_unique_address]] doesn't work in a base class
|
Labels |
new issue
|
Assignees |
|
Reporter |
mingxwa
|
```cpp
struct A {};
struct B {
[[msvc::no_unique_address]] A val;
};
struct C : B {
char x;
};
static_assert(sizeof(C) == 1); // clang-cl thinks sizeof(C) is 2, while it should be 1
```
When the standard `[[no_unique_address]]` is used in regular mode, the memory layout of `C` is expected.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs