public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61161] New: wrong two-stage name lookup for overloaded operators
@ 2014-05-12 21:09 richard-gccbugzilla at metafoo dot co.uk
  2014-05-12 23:45 ` [Bug c++/61161] " richard-gccbugzilla at metafoo dot co.uk
  0 siblings, 1 reply; 2+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2014-05-12 21:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61161

            Bug ID: 61161
           Summary: wrong two-stage name lookup for overloaded operators
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard-gccbugzilla at metafoo dot co.uk

GCC rejects-valid on this:

struct T {
  template<typename T> void f(const T &v) {
    0 << v;
  }
};

namespace N {
  struct X {};
  struct Y : X {};
  void operator<<(int, const X&) {}
}

void operator<<(int, const N::Y&) = delete;

int main() {
  N::Y d;
  T().f(d);
}

This is valid because the deleted operator<< is found by neither unqualified
lookup (within the template) or argument-dependent lookup (which searches
namespace N and not the global namespace).

This seems to be specific to operator syntax; if 'f' is changed to

  operator<<(0, v);

then the code is accepted.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/61161] wrong two-stage name lookup for overloaded operators
  2014-05-12 21:09 [Bug c++/61161] New: wrong two-stage name lookup for overloaded operators richard-gccbugzilla at metafoo dot co.uk
@ 2014-05-12 23:45 ` richard-gccbugzilla at metafoo dot co.uk
  0 siblings, 0 replies; 2+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2014-05-12 23:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61161

Richard Smith <richard-gccbugzilla at metafoo dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> ---
(In reply to Jonathan Wakely from comment #1)
> Maybe related to PR51577

Thanks, I'm pretty sure it's the same thing, dup'ing.

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-12 23:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-12 21:09 [Bug c++/61161] New: wrong two-stage name lookup for overloaded operators richard-gccbugzilla at metafoo dot co.uk
2014-05-12 23:45 ` [Bug c++/61161] " richard-gccbugzilla at metafoo dot co.uk

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).