Fix warning no-overloaded-virtual
authorJan Vorlicek <janvorli@microsoft.com>
Mon, 25 May 2015 19:04:31 +0000 (21:04 +0200)
committerJan Vorlicek <janvorli@microsoft.com>
Tue, 26 May 2015 18:35:14 +0000 (20:35 +0200)
This warning is issued when a derived class defines a virtual method with the
same name as its base class, but different set of parameters. The base class
virtual method is hidden in that case. Clang issues a warning here.
To fix the warning, I have added "using Base::Method" to the private section
of all the derived classes.

CMakeLists.txt
src/debug/daccess/dacdbiimpl.h
src/inc/metadata.h
src/inc/stgpool.h
src/md/compiler/regmeta.h
src/md/inc/recordpool.h

index a9d42c0..f757063 100644 (file)
@@ -279,9 +279,6 @@ add_compile_options(-Werror)
 
 # Disabled warnings
 add_compile_options(-Wno-unused-private-field)
-# A derived class defines a virtual method with the same name as its base
-# class, but different set of parameters.
-add_compile_options(-Wno-overloaded-virtual)
 add_compile_options(-Wno-unused-variable)
 # Explicit constructor calls are not supported by clang (this->ClassName::ClassName())
 add_compile_options(-Wno-microsoft)
index ab9cab5..7da45e6 100644 (file)
@@ -642,6 +642,9 @@ public:
 // CordbAssembly, CordbModule
 // ============================================================================
  
+    using ClrDataAccess::GetModuleData;
+    using ClrDataAccess::GetAddressType;
+
 public:
     // Get the full path and file name to the assembly's manifest module.
     BOOL GetAssemblyPath(VMPTR_Assembly  vmAssembly, 
index d6dc0b7..c765ed5 100644 (file)
@@ -1110,6 +1110,9 @@ EXTERN_GUID(IID_IMDInternalImportENC, 0xe03d7730, 0xd7e3, 0x11d2, 0x8c, 0xd, 0x0
 #define INTERFACE IMDInternalImportENC
 DECLARE_INTERFACE_(IMDInternalImportENC, IMDInternalImport)
 {
+private:
+    using IMDInternalImport::ApplyEditAndContinue;    
+public:
     // ENC only methods here.
     STDMETHOD(ApplyEditAndContinue)(        // S_OK or error.
         MDInternalRW *pDelta) PURE;         // Interface to MD with the ENC delta.
index 153a5b7..5932a51 100644 (file)
@@ -1094,6 +1094,10 @@ private:
 class StgBlobPool : public StgPool
 {
     friend class VerifyLayoutsMD;
+
+    using StgPool::InitNew;
+    using StgPool::InitOnMem;
+    
 public:
     StgBlobPool(ULONG ulGrowInc=DFT_BLOB_HEAP_SIZE) :
         StgPool(ulGrowInc),
index d2ca0fa..10642e4 100644 (file)
@@ -109,6 +109,13 @@ struct CCustAttrHashKey
 class CCustAttrHash : public CClosedHashEx<CCustAttrHashKey, CCustAttrHash>
 {
     typedef CCustAttrHashKey T;
+
+    using CClosedHashEx<CCustAttrHashKey, CCustAttrHash>::Hash;
+    using CClosedHashEx<CCustAttrHashKey, CCustAttrHash>::Compare;
+    using CClosedHashEx<CCustAttrHashKey, CCustAttrHash>::Status;
+    using CClosedHashEx<CCustAttrHashKey, CCustAttrHash>::SetStatus;
+    using CClosedHashEx<CCustAttrHashKey, CCustAttrHash>::GetKey;
+    
 public:
     CCustAttrHash(int iBuckets=37) : CClosedHashEx<CCustAttrHashKey,CCustAttrHash>(iBuckets) {}
     unsigned int Hash(const T *pData);
index 65d8700..15c5532 100644 (file)
 class RecordPool : public StgPool
 {
     friend class VerifyLayoutsMD;
+
+    using StgPool::InitNew;
+    using StgPool::InitOnMem;
+
 public:
     RecordPool() :
         StgPool(1024, 1)