[all-commits] [llvm/llvm-project] 031b77: [clang] Reland: fix getTemplateInstantiationArgs (...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Wed Jul 8 12:54:05 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 031b773b01700acf82f5977a5aa6024621b8211c
      https://github.com/llvm/llvm-project/commit/031b773b01700acf82f5977a5aa6024621b8211c
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2026-07-08 (Wed, 08 Jul 2026)

  Changed paths:
    M clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
    M clang-tools-extra/clangd/SemanticHighlighting.cpp
    M clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp
    M clang/docs/LibASTMatchersReference.html
    M clang/docs/ReleaseNotes.md
    M clang/include/clang/AST/Decl.h
    M clang/include/clang/AST/DeclTemplate.h
    M clang/include/clang/AST/JSONNodeDumper.h
    M clang/include/clang/AST/RecursiveASTVisitor.h
    M clang/include/clang/ASTMatchers/ASTMatchers.h
    M clang/include/clang/ASTMatchers/ASTMatchersInternal.h
    M clang/include/clang/Basic/Specifiers.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/ASTDumper.cpp
    M clang/lib/AST/ASTImporter.cpp
    M clang/lib/AST/Comment.cpp
    M clang/lib/AST/Decl.cpp
    M clang/lib/AST/DeclPrinter.cpp
    M clang/lib/AST/DeclTemplate.cpp
    M clang/lib/AST/JSONNodeDumper.cpp
    M clang/lib/AST/TextNodeDumper.cpp
    M clang/lib/ASTMatchers/Dynamic/Registry.cpp
    M clang/lib/Analysis/ExprMutationAnalyzer.cpp
    M clang/lib/CIR/CodeGen/CIRGenVTables.cpp
    M clang/lib/CodeGen/CGVTables.cpp
    M clang/lib/Index/IndexingContext.cpp
    M clang/lib/InstallAPI/Visitor.cpp
    M clang/lib/Parse/ParseDeclCXX.cpp
    M clang/lib/Sema/HLSLExternalSemaSource.cpp
    M clang/lib/Sema/SemaConcept.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaExprMember.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    M clang/lib/Sema/SemaTemplateDeductionGuide.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/lib/Serialization/ASTReaderDecl.cpp
    M clang/lib/Serialization/ASTWriterDecl.cpp
    M clang/lib/StaticAnalyzer/Core/BugSuppression.cpp
    M clang/lib/Tooling/Syntax/BuildTree.cpp
    M clang/test/AST/ast-dump-templates-pattern.cpp
    M clang/test/CXX/basic/basic.link/p11.cpp
    M clang/test/CXX/drs/cwg18xx.cpp
    M clang/test/CXX/drs/cwg7xx.cpp
    M clang/test/CXX/temp/temp.arg/temp.arg.template/p3-2a.cpp
    M clang/test/CXX/temp/temp.constr/temp.constr.decl/p4.cpp
    M clang/test/CXX/temp/temp.decls/temp.spec.partial/temp.spec.partial.member/p2.cpp
    M clang/test/CXX/temp/temp.spec/temp.expl.spec/p7.cpp
    M clang/test/CodeGenCXX/default-arguments.cpp
    M clang/test/CodeGenCXX/explicit-instantiation.cpp
    A clang/test/Modules/GH208100.cpp
    M clang/test/SemaCXX/GH195416.cpp
    M clang/test/SemaCXX/constant-expression-cxx14.cpp
    M clang/test/SemaCXX/deduced-return-type-cxx14.cpp
    M clang/test/SemaCXX/member-class-11.cpp
    A clang/test/SemaTemplate/GH202358.cpp
    M clang/test/SemaTemplate/concepts-out-of-line-def.cpp
    M clang/test/SemaTemplate/friend-template.cpp
    M clang/test/SemaTemplate/instantiate-scope.cpp
    M clang/test/Templight/templight-default-func-arg.cpp
    M clang/test/Templight/templight-empty-entries-fix.cpp
    M clang/tools/libclang/CIndex.cpp
    M clang/unittests/AST/ASTImporterTest.cpp
    M clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
    M lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
    M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

  Log Message:
  -----------
  [clang] Reland: fix getTemplateInstantiationArgs (#208285)

Relands https://github.com/llvm/llvm-project/pull/199528
Previous: https://github.com/llvm/llvm-project/pull/207825

This implements a new strategy for collecting the template arguments, by
relying on the qualifiers and template parameter lists to navigate the
template
context of out-of-line definitions.

This greatly simplifies the signature of that function, by removing a
bunch
of workarounds, and simpliffying a couple that weren't removed yet.

Since this now relies on qualifiers and template parameter lists,
this patch expends most of its effort making sure these are placed,
transformed and propagated to template instantiations.

Also makes the explicit specialization AST nodes stop abusing the
template
parameter lists by storing it's own template parameter list, creating a
dedicated field for them, similar to partial specializations.

Fixes https://github.com/llvm/llvm-project/issues/202106
Fixes https://github.com/llvm/llvm-project/issues/202109
Fixes #208100
Fixes #202358

Changes since last landing:

* Instantiated method decls uses a separate path, also needs merging of
deduced return type.
* Handle failures instantiating redeclaration for default arguments
(fails in some error recovery scenarios).



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