[PATCH] D46441: [clang][CodeGenCXX] Noalias attr for copy/move constructor arguments

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 5 10:08:44 PDT 2018


rjmccall added a comment.

I'm fine with being more aggressive about this, and I agree that the standard should be making aliasing UB here.  We use a similarly aggressive rule with return values: NRVO can allow direct access to the return slot, which we mark `noalias`, but which can in fact be aliased if we're doing copy-elision in the caller.  IIRC the standard has analogously weak wording about what's supposed to happen in that case, but UB is really the only sensible rule.


Repository:
  rC Clang

https://reviews.llvm.org/D46441





More information about the cfe-commits mailing list