At first glance, how does CallbackType* become a const CallbackType& ? This may be one of many cases where VC++ plays a little loose with C++ type rules...
At least, that's how I read the error message. --Amanda On Tue, Feb 10, 2009 at 6:26 PM, James Hawkins <[email protected]> wrote: > Hi, > > I was porting session_services.cc to posix today, and I ran across a > g++ bug that will definitely block efforts to use CancelableRequest, > at least on Linux. While I'm savvy enough with C++, I'm having > trouble coming up with an explanation for what the problem is here. > I'd like to file a bug with gcc, but I don't want to just toss this > file on their laps. Can someone take a look at the test case I've > attached and see if they can shed some light? btw this test case > compiles successfully in visual studio. > > $ g++ testcase.cc > testcase.cc: In constructor > 'InternalGetCommandsRequest::InternalGetCommandsRequest(CallbackRunner<Tuple2<int, > InternalGetCommandsRequest> >*)': > testcase.cc:89: error: class 'InternalGetCommandsRequest' does not > have any field named 'CancelableRequest' > testcase.cc:89: error: no matching function for call to > 'CancelableRequest<CallbackRunner<Tuple2<int, > InternalGetCommandsRequest> > >::CancelableRequest()' > testcase.cc:21: note: candidates are: > CancelableRequest<CB>::CancelableRequest(CB*) [with CB = > CallbackRunner<Tuple2<int, InternalGetCommandsRequest> >] > testcase.cc:13: note: > CancelableRequest<CallbackRunner<Tuple2<int, > InternalGetCommandsRequest> > >::CancelableRequest(const > CancelableRequest<CallbackRunner<Tuple2<int, > InternalGetCommandsRequest> > >&) > > It seems that the critical point is: > > no matching function for call to > 'CancelableRequest<CallbackRunner<Tuple2<int, > InternalGetCommandsRequest> > >::CancelableRequest()' > > when the code in question is: > > explicit InternalGetCommandsRequest(CallbackType* callback) : > CancelableRequest(callback) { } > > For some reason, g++ is not picking up that we are passing a var of > type CallbackType* which fully translates to: > > const CancelableRequest<CallbackRunner<Tuple2<int, > InternalGetCommandsRequest> > >& > > which would match the expected: > > CancelableRequest<CallbackRunner<Tuple2<int, > InternalGetCommandsRequest> > >::CancelableRequest(const > CancelableRequest<CallbackRunner<Tuple2<int, > InternalGetCommandsRequest> > >&) > > > Thanks, > James Hawkins > > > > --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: [email protected] View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---
