This revision was automatically updated to reflect the committed changes. Closed by commit rGd6e47a405a34: [lldb/TypeSystemClang] Supply trivial TypeSourceInfo to NonTypeTemplateParmDecl… (authored by vsk). Herald added a project: LLDB.
Changed prior to commit: https://reviews.llvm.org/D73808?vs=241819&id=244232#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73808/new/ https://reviews.llvm.org/D73808 Files: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp lldb/test/API/lang/cpp/class-template-parameter-pack/main.cpp Index: lldb/test/API/lang/cpp/class-template-parameter-pack/main.cpp =================================================================== --- lldb/test/API/lang/cpp/class-template-parameter-pack/main.cpp +++ lldb/test/API/lang/cpp/class-template-parameter-pack/main.cpp @@ -34,6 +34,11 @@ bool isIntBool() { return true; } }; +template<int Size> struct array { + int Arr[Size]; + array() {} +}; + int main (int argc, char const *argv[]) { C<int,16,32> myC; @@ -53,12 +58,15 @@ D<int,int> myLesserD; myD.member = 64; (void)D<int,int,bool>().isIntBool(); - (void)D<int,int>().isIntBool(); - return myD.member != 64; //% self.expect("expression -- myD", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["64"]) + (void)D<int,int>().isIntBool(); //% self.expect("expression -- myD", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["64"]) //% self.expect("expression -- myLesserD.isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"]) //% self.expect("expression -- myD.isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"]) // See comment above. //#% self.expect("expression -- D<int, int>().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"]) //#% self.expect("expression -- D<int, int, bool>().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"]) + + array<3> myArray; //% self.expect("expression -- myArray", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["Arr"]) + + return 1; } Index: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp =================================================================== --- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -1277,11 +1277,12 @@ if (name && name[0]) identifier_info = &ast.Idents.get(name); if (IsValueParam(template_param_infos.args[i])) { + QualType template_param_type = + template_param_infos.args[i].getIntegralType(); template_param_decls.push_back(NonTypeTemplateParmDecl::Create( ast, decl_context, SourceLocation(), SourceLocation(), depth, i, - identifier_info, template_param_infos.args[i].getIntegralType(), - parameter_pack, nullptr)); - + identifier_info, template_param_type, parameter_pack, + ast.getTrivialTypeSourceInfo(template_param_type))); } else { template_param_decls.push_back(TemplateTypeParmDecl::Create( ast, decl_context, SourceLocation(), SourceLocation(), depth, i,
Index: lldb/test/API/lang/cpp/class-template-parameter-pack/main.cpp =================================================================== --- lldb/test/API/lang/cpp/class-template-parameter-pack/main.cpp +++ lldb/test/API/lang/cpp/class-template-parameter-pack/main.cpp @@ -34,6 +34,11 @@ bool isIntBool() { return true; } }; +template<int Size> struct array { + int Arr[Size]; + array() {} +}; + int main (int argc, char const *argv[]) { C<int,16,32> myC; @@ -53,12 +58,15 @@ D<int,int> myLesserD; myD.member = 64; (void)D<int,int,bool>().isIntBool(); - (void)D<int,int>().isIntBool(); - return myD.member != 64; //% self.expect("expression -- myD", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["64"]) + (void)D<int,int>().isIntBool(); //% self.expect("expression -- myD", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["64"]) //% self.expect("expression -- myLesserD.isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"]) //% self.expect("expression -- myD.isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"]) // See comment above. //#% self.expect("expression -- D<int, int>().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"]) //#% self.expect("expression -- D<int, int, bool>().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"]) + + array<3> myArray; //% self.expect("expression -- myArray", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["Arr"]) + + return 1; } Index: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp =================================================================== --- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -1277,11 +1277,12 @@ if (name && name[0]) identifier_info = &ast.Idents.get(name); if (IsValueParam(template_param_infos.args[i])) { + QualType template_param_type = + template_param_infos.args[i].getIntegralType(); template_param_decls.push_back(NonTypeTemplateParmDecl::Create( ast, decl_context, SourceLocation(), SourceLocation(), depth, i, - identifier_info, template_param_infos.args[i].getIntegralType(), - parameter_pack, nullptr)); - + identifier_info, template_param_type, parameter_pack, + ast.getTrivialTypeSourceInfo(template_param_type))); } else { template_param_decls.push_back(TemplateTypeParmDecl::Create( ast, decl_context, SourceLocation(), SourceLocation(), depth, i,
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits