[PATCH] D50119: Compiler support for P1144R0 "__is_trivially_relocatable(T)"

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 31 17:20:24 PDT 2018


Quuxplusone created this revision.
Quuxplusone added a reviewer: rsmith.
Quuxplusone added a project: clang.
Herald added a subscriber: cfe-commits.

This is the compiler half of C++ proposal 1144 "Object relocation in terms of move plus destroy," as seen on https://godbolt.org/g/zUUAVW and https://quuxplusone.github.io/blog/2018/07/18/announcing-trivially-relocatable/ .

There are two parts to this compiler support:

- the type trait `__is_trivially_relocatable(T)`, which is similar in spirit to `__is_trivially_destructible(T)`, in that it lets the programmer access information that the compiler itself already knows; and
- the warranting attribute `[[trivially_relocatable]]`, which is similar in spirit to `[[trivial_abi]]`, in that it lets the programmer communicate back to the compiler that a certain user-defined type should be //assumed// to have this property even though it would not //naturally// have the property all else being equal.

The official home of this branch thus far has been https://github.com/Quuxplusone/clang/tree/trivially-relocatable , but I figure that a Clang review would be a good way to get some more eyeballs on it, plus, if we can get it into Clang trunk then I wouldn't have to keep rebasing it every week.


Repository:
  rC Clang

https://reviews.llvm.org/D50119

Files:
  docs/LanguageExtensions.rst
  include/clang/AST/DeclCXX.h
  include/clang/Basic/Attr.td
  include/clang/Basic/AttrDocs.td
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Basic/Features.def
  include/clang/Basic/TokenKinds.def
  include/clang/Basic/TypeTraits.h
  include/clang/Sema/Sema.h
  lib/AST/ASTImporter.cpp
  lib/AST/DeclCXX.cpp
  lib/Parse/ParseDeclCXX.cpp
  lib/Sema/SemaDecl.cpp
  lib/Sema/SemaDeclAttr.cpp
  lib/Sema/SemaDeclCXX.cpp
  lib/Sema/SemaExprCXX.cpp
  lib/Serialization/ASTReaderDecl.cpp
  lib/Serialization/ASTWriter.cpp
  test/Lexer/has_extension_cxx.cpp
  test/Misc/pragma-attribute-supported-attributes-list.test
  test/SemaCXX/trivially-relocatable.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50119.158422.patch
Type: text/x-patch
Size: 39839 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180801/d5da86f7/attachment-0001.bin>


More information about the cfe-commits mailing list