Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang] Add tests from CWG156 to CWG1111 (dual-scope lookup for conve…
…rsion-function-ids) (llvm#121654) This patch adds test from [CWG156](https://cplusplus.github.io/CWG/issues/156.html) to [CWG1111](https://cplusplus.github.io/CWG/issues/1111.html) test, and downgrades the latter to partial availability. The most relevant piece of current wording is [[basic.lookup.unqual]/5](https://eel.is/c++draft/basic.lookup#unqual-5): > An unqualified name that is a component name ([[expr.prim.id.unqual]](https://eel.is/c++draft/expr.prim.id.unqual)) of a [type-specifier](https://eel.is/c++draft/dcl.type.general#nt:type-specifier) or [ptr-operator](https://eel.is/c++draft/dcl.decl.general#nt:ptr-operator) of a [conversion-type-id](https://eel.is/c++draft/class.conv.fct#nt:conversion-type-id) is looked up in the same fashion as the [conversion-function-id](https://eel.is/c++draft/class.conv.fct#nt:conversion-function-id) in which it appears[.](https://eel.is/c++draft/basic.lookup#unqual-5.sentence-1) If that lookup finds nothing, it undergoes unqualified name lookup; in each case, only names that denote types or templates whose specializations are types are considered[.](https://eel.is/c++draft/basic.lookup#unqual-5.sentence-2) Per resolution of [CWG1111](https://cplusplus.github.io/CWG/issues/1111.html), additional lookup in the context of the entire postfix-expression, which originally was intended to cross-check lookup in the context of object-expression, was effectively turned into a fallback for it. Check out "Calling a conversion function" example in [P1787R6](https://wg21.link/p1787r6) for step-by-step explanation of the current lookup mechanics for conversion functions. Clang rejects one of the well-formed examples, hence partial status. Clang is the only implementation which rejects it: https://godbolt.org/z/ohhbx8Mfs
- Loading branch information