[all-commits] [llvm/llvm-project] 3e69e5: [Concepts] Add Decls from the outer scope of the c...

Younan Zhang via All-commits all-commits at lists.llvm.org
Fri Mar 15 21:56:33 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3e69e5a15782a5776a3245170aeb5d97ef746fa5
      https://github.com/llvm/llvm-project/commit/3e69e5a15782a5776a3245170aeb5d97ef746fa5
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2024-03-16 (Sat, 16 Mar 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaConcept.cpp
    M clang/test/SemaTemplate/concepts.cpp

  Log Message:
  -----------
  [Concepts] Add Decls from the outer scope of the current lambda for conversion function constraints (#83420)

This fixes the case shown by
https://github.com/llvm/llvm-project/issues/64808#issuecomment-1929131611.

Similar to
https://github.com/llvm/llvm-project/commit/f9caa12328b265b77221fe7a310d4504673d814a,
we have some calls to constraint checking for a lambda's conversion
function while determining the conversion sequence.

This patch addresses the problem where the requires-expression within
such a lambda references to a Decl outside of the lambda by adding these
Decls to the current instantiation scope.

I'm abusing the flag `ForOverloadResolution` of
CheckFunctionConstraints, which is actually meant to consider the Decls
from parent DeclContexts.

---------

Co-authored-by: cor3ntin <corentinjabot at gmail.com>



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