[all-commits] [llvm/llvm-project] f5efa7: [Sema] When checking for constraint equivalence, d...

Ilya Biryukov via All-commits all-commits at lists.llvm.org
Thu Jan 4 02:58:06 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f5efa74961560070a1e6f127214bcf6b570fef98
      https://github.com/llvm/llvm-project/commit/f5efa74961560070a1e6f127214bcf6b570fef98
  Author: Ilya Biryukov <ibiryukov at google.com>
  Date:   2024-01-04 (Thu, 04 Jan 2024)

  Changed paths:
    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/SemaTemplate/concepts-out-of-line-def.cpp

  Log Message:
  -----------
  [Sema] When checking for constraint equivalence, do not calculate satisfaction (#74490)

... and only look at equivalence of substituted expressions, not results
of constraint satisfaction.
This is required by the standard when matching redeclarations.

Fixes #74314.

There is already some existing machinery for that in
`TemplateInstantiator` and `Sema` exposed separate functions for
substituting expressions with intention to do that:
- `Sema::SubstExpr` should not evaluate constraints.
- `Sema::SubstConstraintExpr` should.

However, both functions used to be equivalent. Introduce a new function
that does not evaluate constraint and use it when matching declarations.

Also change implementation of `SubstConstraintExpr` to call `SubstExpr`
directly so it's obvious they behave in the same way and add a FIXME to
call out that we might need to revamp this approach in the future.




More information about the All-commits mailing list