Bhramar.vatsa added a comment.
Sorry, but I can only add a bit more confusion: https://godbolt.org/z/dzYhhxbz4
There are two cases, only differing in terms of user-defined constructor.
Gcc and clang differs in the two cases. Gcc at least packs the second case
(without user defined constructor),
Bhramar.vatsa added inline comments.
Comment at: clang/lib/AST/RecordLayoutBuilder.cpp:1892
+ bool FieldPacked =
+ (Packed && (!FieldClass || D->getType().isCXX11PODType(Context) ||
+ Context.getLangOpts().getClangABICompat() <=
Maybe irres
Bhramar.vatsa added a comment.
@dblaikie
The condition "FieldClass->isPOD()" returns false for the following case (when
considering field 'struct foo t' of 'struct foo1') :
class foo {
foo() = default;
int _a;
};
struct foo1 {
struct foo t;
} t1;
The same code though