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

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 3 13:04:44 PDT 2018


Quuxplusone added inline comments.


================
Comment at: lib/Sema/SemaDeclCXX.cpp:6187
+        Record->dropAttr<TriviallyRelocatableAttr>();
+      } else if (Record->needsImplicitMoveConstructor() &&
+                 Record->defaultedMoveConstructorIsDeleted()) {
----------------
Rakete1111 wrote:
> Rakete1111 wrote:
> > Quuxplusone wrote:
> > > Rakete1111 wrote:
> > > > This is dead code. `Record` never needs an implicit move constructor at this point, because either 1) it never did or 2) it was defined above by `LookupSpecialMember`.
> > > Confirmed that this code is never hit; and removed. Just for my own information: you're saying that the call to `LookupSpecialMember` on line 6179, even though it's looking up the //destructor//, will actually cause all the `needsImplicitFootor` flags to get resolved? And so also I guess I should never have been looking at those flags directly; I should have handled this case by calling `LookupSpecialMember` like I do on line 6196. Is that basically correct?
> > No, not the 6179 one, but the one before it 6163. Yeah you could have :)
> Sorry for the noise, that isn't it because of the if statement right before 6163 :/. I was wrong...
> 
> Every implicit constructor is already defined before the call to `CheckCompletedCXXClass` (except if it's a template), so `needsImplicitFootor` is always `false`. This means that you can drop the if statement right before 6163, because it's always true.
> 
> I'm 99% sure of the previous paragraph. :)
I notice that `test/SemaCXX/implicit-member-functions.cpp` has started failing in my branch, although there's a *possibility* that that's due to a change in master. I'm going to investigate a little bit.


Repository:
  rC Clang

https://reviews.llvm.org/D50119





More information about the cfe-commits mailing list