[Bug c++/86577] non-ADL name lookup for operator<< at instantiation time?

2020-10-27 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86577

Jonathan Wakely  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED

--- Comment #4 from Jonathan Wakely  ---
.

*** This bug has been marked as a duplicate of bug 51577 ***

[Bug c++/86577] non-ADL name lookup for operator<< at instantiation time?

2020-06-08 Thread leni536 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86577

--- Comment #3 from Lénárd Szolnoki  ---
(In reply to Jonathan Wakely from comment #2)
> Is this a dup of PR 51577 ?

Yes, seems like it is.

[Bug c++/86577] non-ADL name lookup for operator<< at instantiation time?

2020-06-08 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86577

--- Comment #2 from Jonathan Wakely  ---
Is this a dup of PR 51577 ?

[Bug c++/86577] non-ADL name lookup for operator<< at instantiation time?

2020-06-08 Thread leni536 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86577

Lénárd Szolnoki  changed:

   What|Removed |Added

 CC||leni536 at gmail dot com

--- Comment #1 from Lénárd Szolnoki  ---
Other operators seem to be affected as well. This lookup error can be escalated
from accepts-invalid to wrong-code:

#include 

void calls_templated();
void calls_nontemplated();

namespace a {
struct A {};
}

namespace {
template
std::enable_if_t, bool>
operator==(const T&, const T &) {
calls_templated();
return true;
}

template
bool test(const T, const T ) {
return t1==t2;
}

bool operator==(const a::A&, const a::A&) {
calls_nontemplated();
return true;
}
}

int main() {
const a::A a;
test(a, a);
}

gcc 10.1 compiles the code above and calls 'calls_nontemplated()'.