소스 검색

Merge topic 'CM_OVERRIDE-cmTypeMacro'

4e8480db cmTypeMacro: mark overridden functions with CM_OVERRIDE
Brad King 9 년 전
부모
커밋
b399d13568
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      Source/cmTypeMacro.h

+ 5 - 2
Source/cmTypeMacro.h

@@ -15,7 +15,7 @@
 // All subclasses of cmCommand or cmCTestGenericHandler should
 // invoke this macro.
 #define cmTypeMacro(thisClass, superclass)                                    \
-  virtual const char* GetNameOfClass() { return #thisClass; }                 \
+  const char* GetNameOfClass() CM_OVERRIDE { return #thisClass; }             \
   typedef superclass Superclass;                                              \
   static bool IsTypeOf(const char* type)                                      \
   {                                                                           \
@@ -24,7 +24,10 @@
     }                                                                         \
     return Superclass::IsTypeOf(type);                                        \
   }                                                                           \
-  virtual bool IsA(const char* type) { return thisClass::IsTypeOf(type); }    \
+  bool IsA(const char* type) CM_OVERRIDE                                      \
+  {                                                                           \
+    return thisClass::IsTypeOf(type);                                         \
+  }                                                                           \
   static thisClass* SafeDownCast(cmObject* c)                                 \
   {                                                                           \
     if (c && c->IsA(#thisClass)) {                                            \