[clang] [llvm] [Clang] Emit DW_TAG_template_alias for template aliases (PR #87623)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 06:08:34 PDT 2024


OCHyams wrote:

Dependent expressions strike again - https://godbolt.org/z/W381837vr
```
template <int>
using A = int;

template<int I>
struct S {
  using AA = A<I>;
  AA aa;
};

S<0> s;
```
` clang++ -c test.cpp -g -gtemplate-alias`
`clang/lib/AST/ExprConstant.cpp:15721: bool clang::Expr::EvaluateAsRValue(clang::Expr::EvalResult&, const clang::ASTContext&, bool) const: Assertion '!isValueDependent() && "Expression evaluator can't be called on a dependent expression."' failed.`

The issue is `I` is a dependent expression. We have an actual instantiation of S with the value of `I` clearly being `0` here, but I'm not sure whether that information exists in the AST for the `TemplateSpecializationType *`.

Looking into this now (will revert if I can't find a solution).

https://github.com/llvm/llvm-project/pull/87623


More information about the llvm-commits mailing list