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

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 18 09:59:37 PDT 2020


rnk added a comment.

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.


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