[all-commits] [llvm/llvm-project] 64e8d5: [clang] Add tests from CWG156 to CWG1111 (dual-sco...

Vlad Serebrennikov via All-commits all-commits at lists.llvm.org
Sun Jan 5 03:50:17 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 64e8d5b1baaa478c40931d290bf30687a6c93dac
      https://github.com/llvm/llvm-project/commit/64e8d5b1baaa478c40931d290bf30687a6c93dac
  Author: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
  Date:   2025-01-05 (Sun, 05 Jan 2025)

  Changed paths:
    M clang/test/CXX/drs/cwg11xx.cpp
    M clang/test/CXX/drs/cwg1xx.cpp
    M clang/www/cxx_dr_status.html

  Log Message:
  -----------
  [clang] Add tests from CWG156 to CWG1111 (dual-scope lookup for conversion-function-ids) (#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



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