Use the correct namespace for looking up matching operator!= (#68922)
authorUtkarsh Saxena <usaxena95@gmail.com>
Mon, 23 Oct 2023 12:10:06 +0000 (14:10 +0200)
committerTobias Hieta <tobias@hieta.se>
Mon, 20 Nov 2023 08:50:43 +0000 (09:50 +0100)
commit76c7e0e1e2d15706cb9ad28b607e937df5e00c24
treedc47e52a3c249d1fd082c37084bad0670a05897b
parentb5cbb35408a3901900dc2b2ca6adda80a77ea093
Use the correct namespace for looking up matching operator!= (#68922)

`S.getScopeForContext` determins the **active** scope associated with
the given `declContext`.
This fails to find the matching `operator!=` if candidate `operator==`
was found via ADL since that scope is not active.

Instead, just directly lookup using the namespace decl of `operator==`

Fixes #68901

(cherry picked from commit 9330261143ccbe947ef0687fd20747ba47f26879)
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaOverload.cpp
clang/test/CXX/over/over.match/over.match.funcs/over.match.oper/p2468R2.cppm [new file with mode: 0644]
clang/test/CXX/over/over.match/over.match.funcs/over.match.oper/p3-2a.cpp