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++/43282] GCC looks into dependent bases during unqualified lookup



------- Comment #1 from bangerth at gmail dot com  2010-03-07 23:41 -------
The error message I get is this:

g/x> c++ -c x.cc
x.cc: In member function 'void Bar<T>::bar() [with T = A::Baz]':
x.cc:18:   instantiated from here
x.cc:10: error: no matching function for call to 'Bar<A::Baz>::foo(A::Baz)'
x.cc:3: note: candidates are: void HasFoo<T>::foo() [with T = A::Baz]

This error message is given upon instantiation time since the call was
(correctly) considered dependent. At instantiation time, gcc finds the
function in the base class but decides that the arguments don't match --
producing the error. Note that the first scope in which a function is
found terminates the search for possible other candidates, even if the
functions in the first scope in which functions are found don't match.

Consequently the code is rejected. Why do you think this
is not the correct behavior?

W.


-- 

bangerth at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at gmail dot com
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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