[PATCH] D45176: implement recent "standard-layout" changes

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 2 12:15:47 PDT 2018


rsmith created this revision.
rsmith added a reviewer: rjmccall.
Herald added subscribers: sunfish, aheejin, dschuff, sanjoy, jfb.

DR1672, DR1813, DR1881, DR2120: Implement recent fixes to "standard layout" rules.

The new rules say that a standard-layout struct has its first non-static data member and all base classes at offset 0, and consider a class to not be standard-layout if that would result in multiple subobjects of a single type having the same address.

John, this results in an ABI break for the three ABI variants that use "C++11 POD" to determine whether to reuse tail padding (64-bit iOS, WatchOS, and wasm). For now, I've made this restore the former behavior under `-fclang-abi-compat=6`, but it's probably better to instead say that "C++11 POD" takes into account standard-layout-as-specified-in-ISO-C++11 and thereby avoid any ABI change. What do you think?


Repository:
  rC Clang

https://reviews.llvm.org/D45176

Files:
  AST/ASTImporter.cpp
  AST/DeclCXX.cpp
  CXX/drs/dr14xx.cpp
  CXX/drs/dr16xx.cpp
  CXX/drs/dr18xx.cpp
  CXX/drs/dr21xx.cpp
  CXX/drs/dr22xx.cpp
  Layout/v6-standard-layout.cpp
  ReleaseNotes.rst
  SemaCXX/type-traits.cpp
  Serialization/ASTReaderDecl.cpp
  Serialization/ASTWriter.cpp
  clang/AST/DeclCXX.h
  cxx_dr_status.html
  make_cxx_dr_status

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45176.140656.patch
Type: text/x-patch
Size: 28842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180402/bb40fb8e/attachment-0001.bin>


More information about the cfe-commits mailing list