[PATCH] D139095: [clang] Add test for CWG405

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 5 07:00:57 PST 2022


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang/test/CXX/drs/dr4xx.cpp:99
+    void test3(A::S as) { using A::f; f(as); } // ok
+    void test4(A::S as) { using B::f; f(as); } // ok
+    void test5(A::S as) { int f; f(as); } // expected-error {{called object type 'int'}}
----------------
Endill wrote:
> I'm surprised that local function declaration prevents ADL, but //using-declaration// doesn't. It has been working this way all along, so I guess I better take a note of this.
A using-declaration is the idiomatic way to use ADL: https://en.cppreference.com/w/cpp/language/adl (see just after the Notes heading), but pretty much everything about ADL is a surprise to most folks. :-)


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

https://reviews.llvm.org/D139095



More information about the cfe-commits mailing list