[all-commits] [llvm/llvm-project] feb93d: [clang] Add test for CWG2370

Vlad Serebrennikov via All-commits all-commits at lists.llvm.org
Tue Apr 11 12:04:17 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: feb93d28b02c41ca6b069ec1f9e62fdfbb4c8b6c
      https://github.com/llvm/llvm-project/commit/feb93d28b02c41ca6b069ec1f9e62fdfbb4c8b6c
  Author: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
  Date:   2023-04-11 (Tue, 11 Apr 2023)

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

  Log Message:
  -----------
  [clang] Add test for CWG2370

[[https://wg21.link/p1787 | P1787]]: CWG2370 is resolved by performing a search in (only) the immediate scope of any friend, per the [[ http://wiki.edg.com/bin/view/Wg21sandiego2018/CoreWorkingGroup#Core_issue_2370_friend_declarati | CWG opinion from San Diego ]].
Wording: In a friend declaration declarator whose declarator-id is a qualified-id whose lookup context is a class or namespace S, lookup for an unqualified name that appears after the declarator-id performs a search in the scope associated with S. If that lookup finds nothing, it undergoes unqualified name lookup. ([basic.lookup.unqual]/6).

Clarification for P1787 description: when applied to the test in this patch, "immediate scope" refers to `N`, and "(only)" refers to the fact that `type` is not searched in parent scope of `N`. See example after the wording if additional clarification is needed. The most relevant line there is `friend void A::f(F);  // OK`.

Reviewed By: #clang-language-wg, shafik

Differential Revision: https://reviews.llvm.org/D147848




More information about the All-commits mailing list