public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/86577] non-ADL name lookup for operator<< at instantiation time?
[not found] <bug-86577-4@http.gcc.gnu.org/bugzilla/>
@ 2020-06-08 17:30 ` leni536 at gmail dot com
2020-06-08 19:23 ` redi at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 4+ messages in thread
From: leni536 at gmail dot com @ 2020-06-08 17:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86577
Lénárd Szolnoki <leni536 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |leni536 at gmail dot com
--- Comment #1 from Lénárd Szolnoki <leni536 at gmail dot com> ---
Other operators seem to be affected as well. This lookup error can be escalated
from accepts-invalid to wrong-code:
#include <type_traits>
void calls_templated();
void calls_nontemplated();
namespace a {
struct A {};
}
namespace {
template<typename T>
std::enable_if_t<std::is_same_v<T, a::A>, bool>
operator==(const T&, const T &) {
calls_templated();
return true;
}
template<typename T>
bool test(const T&t1, const T &t2) {
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()'.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/86577] non-ADL name lookup for operator<< at instantiation time?
[not found] <bug-86577-4@http.gcc.gnu.org/bugzilla/>
2020-06-08 17:30 ` [Bug c++/86577] non-ADL name lookup for operator<< at instantiation time? leni536 at gmail dot com
@ 2020-06-08 19:23 ` redi at gcc dot gnu.org
2020-06-08 19:34 ` leni536 at gmail dot com
2020-10-27 13:56 ` redi at gcc dot gnu.org
3 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2020-06-08 19:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86577
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Is this a dup of PR 51577 ?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/86577] non-ADL name lookup for operator<< at instantiation time?
[not found] <bug-86577-4@http.gcc.gnu.org/bugzilla/>
2020-06-08 17:30 ` [Bug c++/86577] non-ADL name lookup for operator<< at instantiation time? leni536 at gmail dot com
2020-06-08 19:23 ` redi at gcc dot gnu.org
@ 2020-06-08 19:34 ` leni536 at gmail dot com
2020-10-27 13:56 ` redi at gcc dot gnu.org
3 siblings, 0 replies; 4+ messages in thread
From: leni536 at gmail dot com @ 2020-06-08 19:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86577
--- Comment #3 from Lénárd Szolnoki <leni536 at gmail dot com> ---
(In reply to Jonathan Wakely from comment #2)
> Is this a dup of PR 51577 ?
Yes, seems like it is.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/86577] non-ADL name lookup for operator<< at instantiation time?
[not found] <bug-86577-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2020-06-08 19:34 ` leni536 at gmail dot com
@ 2020-10-27 13:56 ` redi at gcc dot gnu.org
3 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2020-10-27 13:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86577
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|UNCONFIRMED |RESOLVED
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
.
*** This bug has been marked as a duplicate of bug 51577 ***
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-10-27 13:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-86577-4@http.gcc.gnu.org/bugzilla/>
2020-06-08 17:30 ` [Bug c++/86577] non-ADL name lookup for operator<< at instantiation time? leni536 at gmail dot com
2020-06-08 19:23 ` redi at gcc dot gnu.org
2020-06-08 19:34 ` leni536 at gmail dot com
2020-10-27 13:56 ` redi at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).