================
@@ -2115,6 +2191,19 @@ bool DWARFASTParserClang::ParseTemplateDIE(
 
       if (tag == DW_TAG_template_value_parameter && uval64_valid) {
         if (auto value = MakeAPValue(ast, clang_type, uval64)) {
+          // For pointer-to-member types, try to resolve to the actual 
FieldDecl
+          if (clang_type.IsMemberDataPointerType()) {
+            if (auto *field =
+                    ResolveMemberDataPointerToFieldDecl(die, uval64)) {
+              template_param_infos.InsertArg(
+                  name, clang::TemplateArgument(
+                            field, ClangUtil::GetQualType(clang_type),
+                            is_default_template_arg));
+              return true;
+            }
+            // Failed to resolve FieldDecl, fall through to integer path
----------------
zyn-li wrote:

LLDB would display the template argument as a raw numeric offset (e.g., Foo<2>) 
instead of the symbolic member name (e.g., Foo<&MyClass::my_field>). It's a 
presentation degradation, not a functional failure. 

Do you want me to include this in the comment?

https://github.com/llvm/llvm-project/pull/187598
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to