[all-commits] [llvm/llvm-project] 38d71c: [Clang] Fix the assertion condition after b8d1f3d6...

Younan Zhang via All-commits all-commits at lists.llvm.org
Mon Mar 24 01:47:11 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 38d71c9bdcf6b10c6fe02d5bd74fc8e6efb50a4d
      https://github.com/llvm/llvm-project/commit/38d71c9bdcf6b10c6fe02d5bd74fc8e6efb50a4d
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2025-03-24 (Mon, 24 Mar 2025)

  Changed paths:
    M clang/lib/Sema/SemaTemplateDeductionGuide.cpp
    M clang/test/SemaTemplate/deduction-guide.cpp

  Log Message:
  -----------
  [Clang] Fix the assertion condition after b8d1f3d6 (#132669)

Thanks to the example provided by MagentaTreehouse, I realized the
assertion I added in b8d1f3d6 didn't cover all valid cases like, when
inheriting from a class template specialization, the source of a
synthesized template parameter might be an implicit specialization,
whose inner function template is thus living at depth 0, for which we
don’t want it to overflow too.

I've decided to remove that assertion because I don't think it's
particularly useful: we're checking whether Depth = 0 parameters come
from function templates whose parents contribute no template parameters
to the depth, which is redundant given what the template depth already
means.

This also incorporates a drive-by fix for
https://github.com/llvm/llvm-project/pull/132061#discussion_r2008756718,
which I somehow missed.



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