[all-commits] [llvm/llvm-project] 8b7263: [clang] CTAD: use index and depth to retrieve temp...

Haojian Wu via All-commits all-commits at lists.llvm.org
Thu Jul 11 07:04:00 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8b7263ba3051125ab2bb9df514bdaadaca1b637d
      https://github.com/llvm/llvm-project/commit/8b7263ba3051125ab2bb9df514bdaadaca1b637d
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2024-07-11 (Thu, 11 Jul 2024)

  Changed paths:
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/test/AST/ast-dump-ctad-alias.cpp

  Log Message:
  -----------
  [clang] CTAD: use index and depth to retrieve template parameter for TemplateParamsReferencedInTemplateArgumentList (#98013)

As described in https://github.com/llvm/llvm-project/issues/90209#issuecomment-2135972202,
Clang may not preserve enough information during template argument
deduction. This can result in a merely canonical `TemplateTypeParmType`
with a null `Decl`, leading to an incomplete template parameter list for
the synthesized deduction guide.

This patch addresses the issue by using the index and depth information
to retrieve the corresponding template parameter, rather than relying on
`TTP->getDecl()`.

Fixes #90209



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list