Unverified Commit 3e69e5a1 authored by Younan Zhang's avatar Younan Zhang Committed by GitHub
Browse files

[Concepts] Add Decls from the outer scope of the current lambda for conversion...

[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: default avatarcor3ntin <corentinjabot@gmail.com>
parent 5a3cc7ba
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment