[libcxx-commits] [libcxxabi] [llvm] [ItaniumDemangle] Set `InConstraintExpr` to `true` when demangling a c… (PR #107385)
Michael Buch via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Sep 10 03:58:51 PDT 2024
================
@@ -0,0 +1,3 @@
+RUN: llvm-cxxfilt -n _ZN3FooIiE6methodITk4TrueIT_EiEEvS3_ | FileCheck %s
+
+CHECK: void Foo<int>::method<int>(T)
----------------
Michael137 wrote:
This looks weird to me actually. I think a user would be confused as to where this `T` here came from. I don't think we ever output the generic template parameter names here. Probably what happened here is that the `S3_` substitution picks up the fake constraint argument name that we deduced because of ` HasIncompleteTemplateParameterTracking`.
I think what we really want to do is track the parameter levels properly, so that constraint expressions have access to template parameters in enclosing scopes. Currently `parseTemplateArgs` creates a fresh template parameter level because (from what I can tell) the demangler assumes we never reference template parameters from outer levels. But that's not the case anymore with constraints it looks like. Maybe just avoiding clearing the level if we're parsing a `Tk` is enough? I'm not sure atm, but maybe @zygoloid @urnathan have some better ideas here
https://github.com/llvm/llvm-project/pull/107385
More information about the libcxx-commits
mailing list