[PATCH] D148506: [C++] Don't filter using declaration when we perform qualified look up

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 17 02:16:17 PDT 2023


ChuanqiXu added inline comments.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:1824-1826
+static bool isUsingDeclAtClassScope(NamedDecl *D) {
+  if (D->getDeclContext()->isFileContext())
+    return false;
----------------
This is the ad-hoc change. Look at the following comment.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:6375-6378
-    // C++ [dcl.meaning]p1:
-    //   [...] the member shall not merely have been introduced by a
-    //   using-declaration in the scope of the class or namespace nominated by
-    //   the nested-name-specifier of the declarator-id.
----------------
I can't find the wording in the existing spec (at least not in current [dcl.meaning]). But if p8.cpp will be accepted unexpectedly if I remove `RemoveUsingDecls(Previous);` completely. It would look good to me if we can remove `RemoveUsingDecls(Previous);` completely.


================
Comment at: clang/test/CXX/special/class.inhctor/p8.cpp:32-33
 
+// FIMXE: Why should the following line be rejected?
 template<typename T> constexpr D::D(T t) : C(t) {} // expected-error {{does not match any declaration in 'D'}}
----------------
I don't understand why this should be rejected. I tried to read P0136R1 but I failed to find the related things and I don't find a related wording in the current spec.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148506/new/

https://reviews.llvm.org/D148506



More information about the cfe-commits mailing list