rsmith added a comment.

In https://reviews.llvm.org/D47607#1118464, @EricWF wrote:

> One other concern I have is if there will be any performance impact to using 
> `launder` all the time, but better safe than sorry.


In the short-to-medium term, I think we can tackle this by adding an attribute:

  // ...
  struct pair {
    T first;
    [[clang::not_actually_const]] U second;
  };

... to directly express that the `second` field of a non-const `pair` is never 
a const subobject, even if `U` is a `const`-qualified type. I think we'll need 
this once we head down the path of `constexpr` containers, otherwise 
`node_handle`s are not going to work in constant expression evaluation.

Then we can remove the `launder` calls for implementations that support the 
attribute.


https://reviews.llvm.org/D47607



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to