This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/44516] New: unclear error message for invalid operands to binary operator


Testcase:

namespace services {
  struct WebService {  };
}
namespace myapp {
  namespace servers {
    struct Server {  };
  }
}

using namespace myapp;
void addHTTPService(servers::Server const &server, ::services::WebService const
*http) {
  server += http;
}

gcc-4.6:

clang-4.C:12:13: error: no match for ?operator+=? in ?server += http?

Note that the column number points to http.

clang:

 t.cpp:9:10: error: invalid operands to binary expression ('servers::Server
const' and '::services::WebService const *')
    server += http;
    ~~~~~~ ^  ~~~~


-- 
           Summary: unclear error message for invalid operands to binary
                    operator
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: manu at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]