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

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 17 09:51:55 PST 2018


Quuxplusone added inline comments.


================
Comment at: lib/Parse/ParseDeclCXX.cpp:3811
   case ParsedAttr::AT_CXX11NoReturn:
+  case ParsedAttr::AT_TriviallyRelocatable:
     return true;
----------------
erichkeane wrote:
> A note for future reviewers, after the C++11 spelling is removed, this likely needs to go as well.
With this line:
```
struct [[clang::trivially_relocatable()]] A {};
// expected-error at -1 {{attribute 'trivially_relocatable' cannot have an argument list}}
struct [[clang::trivially_relocatable(42)]] B {};
// expected-error at -1 {{attribute 'trivially_relocatable' cannot have an argument list}}
```
Without this line:
```
struct [[clang::trivially_relocatable()]] A {};
struct [[clang::trivially_relocatable(42)]] B {};
// expected-error at -1 {{'trivially_relocatable' attribute takes no arguments}}
```
IMO the former behavior (with this line) is //much// preferable to the latter behavior. I think I wish this switch statement included //all// attributes!


Repository:
  rC Clang

https://reviews.llvm.org/D50119





More information about the cfe-commits mailing list