aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorantangelo <contact@antangelo.com>2023-10-24 14:07:52 -0400
committerGitHub <noreply@github.com>2023-10-24 14:07:52 -0400
commitf418319730341e9d41ce8ead6fbfe5603c343985 (patch)
tree3e9d461bea9f0c2efa72b128b126cb80829c2c8a /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parent49504674dbca6f753771f790ea4062bcbc9cc829 (diff)
downloadllvm-f418319730341e9d41ce8ead6fbfe5603c343985.zip
llvm-f418319730341e9d41ce8ead6fbfe5603c343985.tar.gz
llvm-f418319730341e9d41ce8ead6fbfe5603c343985.tar.bz2
Reland "[clang][Sema] Use original template pattern when declaring implicit deduction guides for nested template classes" (#69676)
Reland of dd0fba11690f9fef304d5f48cde646e5eca8d3c0 When a nested template is instantiated, the template pattern of the inner class is not copied into the outer class ClassTemplateSpecializationDecl. The specialization contains a ClassTemplateDecl with an empty record that points to the original template pattern instead. As a result, when looking up the constructors of the inner class, no results are returned. This patch finds the original template pattern and uses that for the lookup instead. Based on CWG2471 we must also substitute the known outer template arguments when creating deduction guides for the inner class. Changes from the last iteration: 1. The outer retained levels from the outer template are always added to the `MultiLevelTemplateArgumentList` for rewriting `FunctionTemplateDecl` arguments, even if there is no FTD and the arguments are empty. 2. When building implicit deduction guides, the template pattern underlying decl is pushed as the current context. This resolves the issue where `FindInstantiatedDecl` is unable to find the inner template class. 3. Tests are updated to cover the failing case, and to assert that the type is correct after argument deduction in the implicit case.
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
0 files changed, 0 insertions, 0 deletions