Open OCHyams opened 2 weeks ago
@llvm/issue-subscribers-debuginfo
Author: Orlando Cazalet-Hyams (OCHyams)
Sorry - I added some "assignees" accidentally (I assumed the box was the same as the pull request "reviewers" one - I wasn't trying to assign this task to anyone).
@AaronBallman Any idea how, given a TypeAliasTemplateDecl
, we might be able to get to the template arguments that the type alias was instantiated with? It looks like all the template arguments are uninstantiated (i.e., dependent on other parameters.
The TypeAliasTemplateDecl
is the uninstantiated template; it becomes a TypeAliasDecl
once it is instantiated. So I think you'd need to look at the ClassTemplateSpecializationDecl
for S<0>
and that should have a TypeAliasDecl
that references A<0>
.
Thank you for your help - I'll look into this shortly. I have a work-around here #90032 to avoid the assertion failure for the time being.
@llvm/issue-subscribers-clang-codegen
Author: Orlando Cazalet-Hyams (OCHyams)
87623 adds an option
-gtemplate-alias
which tells Clang to emit type metadata that can be used to buildDW_TAG_template_alias
DWARF DIEs instead ofDW_TAG_typedefs
for template aliases. In order to do this we need to createDIType *
s for all the template arguments.This case causes an assertion:
Remove
-Xclang -dump-ast
from this Godbolt example to see the assertion: https://godbolt.org/z/dPEcbnebaThe
TemplateSpecializationType
passed toCGDebugInfo::CreateType
forS<0>::AA
's underlying typeA<I>
looks like this:I'm trying to fix the issue, but I'm not particularly familiar with the front end or Clang AST.
Is it possible to resolve the dependent expression
I
inA<I>
to0
?S
has been instantiated, so it feels like we should have that information available, but I'm not sure where it exists in the AST.If anyone is able to point me in the right direction or at some documentation that would be greatly appreciated.