public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94214] New: function lookup with overloaded operators accepts invalid
@ 2020-03-18 13:27 niklas at nolte dot dev
2020-03-18 16:27 ` [Bug c++/94214] " redi at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: niklas at nolte dot dev @ 2020-03-18 13:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94214
Bug ID: 94214
Summary: function lookup with overloaded operators accepts
invalid
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: niklas at nolte dot dev
Target Milestone: ---
Sample code:
```
#include <vector>
template <typename T>
void blub(std::vector<T> const& i) {
-i;
//getsize(i); //this also fails in gcc
}
int operator-(std::vector<int> const& i) {
return i.size();
}
int getsize(std::vector<int> const& i) {
return i.size();
}
int main() { blub(std::vector<int>{1}); }
```
this shouldn't compile, it doesn't in clang..
See
- https://godbolt.org/z/hgGeH3
-
https://stackoverflow.com/questions/60740257/clang-vs-gcc-function-lookup-with-operator-overloads?noredirect=1#comment107466162_60740257
-
https://stackoverflow.com/questions/58793092/two-phase-function-template-compilation-not-only-adl-is-employed-in-the-2nd-p
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/94214] function lookup with overloaded operators accepts invalid
2020-03-18 13:27 [Bug c++/94214] New: function lookup with overloaded operators accepts invalid niklas at nolte dot dev
@ 2020-03-18 16:27 ` redi at gcc dot gnu.org
2020-03-18 16:52 ` niklas at nolte dot dev
2020-03-18 17:20 ` redi at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2020-03-18 16:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94214
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Looks like a dup of PR 51577
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/94214] function lookup with overloaded operators accepts invalid
2020-03-18 13:27 [Bug c++/94214] New: function lookup with overloaded operators accepts invalid niklas at nolte dot dev
2020-03-18 16:27 ` [Bug c++/94214] " redi at gcc dot gnu.org
@ 2020-03-18 16:52 ` niklas at nolte dot dev
2020-03-18 17:20 ` redi at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: niklas at nolte dot dev @ 2020-03-18 16:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94214
--- Comment #2 from niklas at nolte dot dev ---
(In reply to Jonathan Wakely from comment #1)
> Looks like a dup of PR 51577
agreed
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/94214] function lookup with overloaded operators accepts invalid
2020-03-18 13:27 [Bug c++/94214] New: function lookup with overloaded operators accepts invalid niklas at nolte dot dev
2020-03-18 16:27 ` [Bug c++/94214] " redi at gcc dot gnu.org
2020-03-18 16:52 ` niklas at nolte dot dev
@ 2020-03-18 17:20 ` redi at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2020-03-18 17:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94214
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|UNCONFIRMED |RESOLVED
--- Comment #3 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-03-18 17:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18 13:27 [Bug c++/94214] New: function lookup with overloaded operators accepts invalid niklas at nolte dot dev
2020-03-18 16:27 ` [Bug c++/94214] " redi at gcc dot gnu.org
2020-03-18 16:52 ` niklas at nolte dot dev
2020-03-18 17:20 ` 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).