[Lldb-commits] [PATCH] D75761: Fix to get the AST we generate for function templates to be closer to what clang generates and expects

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 6 11:35:44 PST 2020


shafik created this revision.
shafik added reviewers: teemperor, aprantl.

Fix to get the AST we generate for function templates closer to what clang generates and expects. We fix which `FuntionDecl` we are passing to `CreateFunctionTemplateSpecializationInfo` and we strip template parameters from the name when creating the `FunctionDecl` and `FunctionTemplateDecl`.

These two fixes together fix asserts and ambiguous  lookup issues for several cases which are added to the already existing small function template test. This fixes issues with overloads, overloads and ADL, variadic function templates and templated operator overloads.

The recent fix D75545 <https://reviews.llvm.org/D75545> came out of this patch and there will be at least one more patch to deal with and edge case with templated `operator<` when it is in a namespace. We do C++ name parsing in `CPlusPlusNameParser` and we don’t deal with cases like `A::operator<<A::B>` properly.

Currently the fix applies mostly to dsym cases and I will be working on a fix that will apply to all cases but it may be a separate PR.


https://reviews.llvm.org/D75761

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/test/API/lang/cpp/template-function/TestTemplateFunctions.py
  lldb/test/API/lang/cpp/template-function/main.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75761.248796.patch
Type: text/x-patch
Size: 8101 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200306/25ef52cd/attachment.bin>


More information about the lldb-commits mailing list