[all-commits] [llvm/llvm-project] 455681: [Sema] Use lexical DC for friend functions when ge...

antangelo via All-commits all-commits at lists.llvm.org
Fri Jan 12 06:02:13 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 45568135cbb31bb3b345a8355134970742248120
      https://github.com/llvm/llvm-project/commit/45568135cbb31bb3b345a8355134970742248120
  Author: antangelo <contact at antangelo.com>
  Date:   2024-01-12 (Fri, 12 Jan 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    A clang/test/SemaTemplate/GH75426.cpp

  Log Message:
  -----------
  [Sema] Use lexical DC for friend functions when getting constraint instantiation args (#77552)

Fixes a crash where the template argument depth computed in the semantic
context for a friend FunctionDecl with a constrained parameter is
compared against arguments in the lexical context for the purpose of
checking if the constraint depends on enclosing template parameters.

Since getTemplateInstantiationArgs in this case follows the semantic DC
for friend FunctionDecls, the resulting depth is incorrect and trips an
assertion.

Fixes #75426




More information about the All-commits mailing list