[all-commits] [llvm/llvm-project] 445028: [Clang] Refactor instantiation of declarations wit...

Younan Zhang via All-commits all-commits at lists.llvm.org
Fri Sep 11 09:52:59 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 445028c28190b9c883c08cb2ef69e002b65e5af9
      https://github.com/llvm/llvm-project/commit/445028c28190b9c883c08cb2ef69e002b65e5af9
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2026-09-12 (Sat, 12 Sep 2026)

  Changed paths:
    M clang/docs/ReleaseNotes.md
    M clang/include/clang/Sema/Sema.h
    M clang/include/clang/Sema/Template.h
    M clang/lib/Sema/SemaConcept.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/test/SemaCXX/cxx2c-fold-exprs.cpp
    M clang/test/SemaTemplate/concepts-lambda.cpp

  Log Message:
  -----------
  [Clang] Refactor instantiation of declarations within concepts (#221707)

After implementation of CWG2369, declarations are instantiated on demand
when evaluating a concept.

This was hinged on TemplateInstantiator, where we intercepted most calls
that need an instantiated declaration. This is almost identity to
SetupConstraintScope, which tries to re-instantiate any declarations to
the current scope. This patch removes SetupConstraintScope because we
can instantiate anything on demand.

The concept normalization patch brings us more troubles when we have to
deal with sugars: declarations instantiated outside of the scope (e.g. a
typedef declaration) are never added/instantiated during instantiation
of concepts: this patch makes that function also look up outer scopes
for those declarations. Note that we couldn't simply make the scope of
concepts 'transparent', since we don't want clashes of instantiated
function parameters.

Also also this added a call to instantiateMissingDeclsToScopeForConcepts
for C++26 fold expressions, before checking any pack sizes.

Fixes https://github.com/llvm/llvm-project/issues/198052
Fixes https://github.com/llvm/llvm-project/issues/209632



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