http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57739

            Bug ID: 57739
           Summary: Weaker diagnostics of failed overload resolution when
                    operators are declared as friends instead of
                    externally
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unmobile at gmail dot com

Created attachment 30395
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30395&action=edit
Base example of almost-OK error reporting

$ /opt/local/bin/g++-mp-4.9 --version
g++-mp-4.9 (MacPorts gcc49 4.9-20130623_0) 4.9.0 20130623 (experimental)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ /opt/local/bin/g++-mp-4.9 -c puptest.C
puptest.C: In member function 'void SDAG::Closure::packClosure(PUP::er&)':
puptest.C:34:9: error: no match for 'operator|' (operand types are 'PUP::er'
and 'A {aka int}')
       p | continuations;
         ^
puptest.C:34:9: note: candidates are:
puptest.C:24:8: note: void SDAG::operator|(PUP::er&, SDAG::Closure&)
   void operator|(PUP::er &p, Closure &a);
        ^
puptest.C:24:8: note:   no known conversion for argument 2 from 'A {aka int}'
to 'SDAG::Closure&'
puptest.C:28:8: note: void SDAG::operator|(PUP::er&, SDAG::Closure*&)
   void operator|(PUP::er &p, Closure* &a);
        ^
puptest.C:28:8: note:   no known conversion for argument 2 from 'A {aka int}'
to 'SDAG::Closure*&'


$ /opt/local/bin/g++-mp-4.9 -c puptest_friend.C
puptest_friend.C: In member function 'void
SDAG::Closure::packClosure(PUP::er&)':
puptest_friend.C:34:9: error: no match for 'operator|' (operand types are
'PUP::er' and 'A {aka int}')
       p | continuations;
         ^

Reply via email to