clang issues a warning when compiling the following code:
struct Base { virtual void * get(char* e);
Warning:
warning: 'Derived::get' hides overloaded virtual function [-Woverloaded-virtual]
(the warning should be included, of course).
I do not understand why. Note that uncommenting the same declaration in Base disables the warning. I understand that since the two get () functions have different signatures, there can be no hiding.
Is it correct? Why?
Please note that this is on MacOS X running the latest version of Xcode.
clang --version Apple LLVM version 5.0 (clang-500.1.74) (based on LLVM 3.3svn)
Update: Same behavior with Xcode 4.6.3.
c ++ overloading virtual warnings hidden
Jean-Denis Muys Aug 29 '13 at 15:32 2013-08-29 15:32
source share