[Clang] Fix definition of layout-compatible to ignore empty classes (#92103)
authorMital Ashok <mital@mitalashok.co.uk>
Thu, 1 Aug 2024 14:05:46 +0000 (15:05 +0100)
committerTobias Hieta <tobias@hieta.se>
Sun, 4 Aug 2024 09:23:47 +0000 (11:23 +0200)
commit56f4adeee36560b839d0d04d4a5a8d8935006f63
tree2e2789a8444ce2ac4dcfac2327d2d39f37b44061
parent7bfc4abb54db7ba2fc6ddf53f30bed752af57626
[Clang] Fix definition of layout-compatible to ignore empty classes (#92103)

Also changes the behaviour of `__builtin_is_layout_compatible`

None of the historic nor the current definition of layout-compatible
classes mention anything about base classes (other than implicitly
through being standard-layout) and are defined in terms of members, not
direct members.
clang/include/clang/AST/DeclCXX.h
clang/lib/AST/DeclCXX.cpp
clang/lib/Sema/SemaChecking.cpp
clang/test/SemaCXX/type-traits.cpp
llvm/include/llvm/ADT/STLExtras.h