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

Reply via email to