[PATCH] D87808: [DebugInfo] Fix bug in constructor homing where it would use ctor homing when a class only has copy/move constructors

Amy Huang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 21 15:56:49 PDT 2020


akhuang added a comment.

In D87808#2282223 <https://reviews.llvm.org/D87808#2282223>, @rnk wrote:

> In D87808#2280197 <https://reviews.llvm.org/D87808#2280197>, @dblaikie wrote:
>
>> @rsmith What's the deal with these anonymous structs/unions? Why do they have copy/move constructors (are those technically called from the enclosing class's copy/move constructors?) but no default constructor to be called from the other ctors of the enclosing class?
>
> Yes, I'm curious: copy and move constructors require an object of this type to already exist in memory. Is there a well-defined way of creating an object of this type in memory when it has no other constructors?
>
> Maybe the issue is that this code is running into the lazy implicit special member declaration optimization. Maybe the class in question has an implicit, trivial, default constructor, but we there is no CXXConstructorDecl present in the ctors list for the loop to find.

Yeah, I'd guess that it has a constructor but it doesn't show up in the loop?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87808/new/

https://reviews.llvm.org/D87808



More information about the cfe-commits mailing list