This is an archive of the discontinued LLVM Phabricator instance.

[RFC/WIP][clang] Fix printing of names of inherited constructors
Needs ReviewPublic

Authored by labath on May 15 2020, 5:42 AM.

Details

Reviewers
rsmith
dblaikie
Summary

This is a fairly hacky fix to the following problem: Debug information
entries for inherited constructors are emitted with the name of the base
class, instead of the inheriting class.

This problem can be tracked down to a FIXME in
Sema::findInheritingConstructor, which works around the problem of not
having a DeclarationName to describe inherited constructors. The current
patch compounds that workaround by printing the inherited constructor
name in a different way.

I don't really expect this patch to make its way into the tree in the
current form. I am mainly putting it up to point out the problem and
start a discussion on the solution. I suppose the right fix is to
implement the FIXME, and add a new DeclarationName kind. But that seems
like it could be a fairly involved change, so I wanted to get some
confirmation (and maybe a bit of guidance) first.

Diff Detail

Event Timeline

labath created this revision.May 15 2020, 5:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2020, 5:42 AM
Herald added a subscriber: aprantl. · View Herald Transcript

@rsmith - this changes printing the name of inherited constructors in general, not just for debug info - could you take a gander and make sure that's probably OK for other callers trying to print the name of an inheriting constructor?