1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0028355: Stating wrong parent class in DEFINE_STANDARD_RTTIEXT is not recognized during compilation

Added compile-time checks (static_assert) in DEFINE_STANDARD_RTTI*(A,B) macros to check that A is actually the class being defined, and B is its base class.
For GCC compiler version 4.7 and later on, check ensures that B is direct base class of A.

Fixed dubious RTTI definitions.
This commit is contained in:
Benjamin Bihler
2017-01-19 16:48:08 +03:00
committed by apn
parent f63101c984
commit 0e9fe060f3
11 changed files with 66 additions and 15 deletions

View File

@@ -30,7 +30,7 @@ public:
// Execution.
virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
DEFINE_STANDARD_RTTIEXT(CircleDriver, TFunction_Driver)
DEFINE_STANDARD_RTTIEXT(CircleDriver, BaseDriver)
};
#endif // !defined(_CIRCLEDRIVER_H_)

View File

@@ -30,7 +30,7 @@ public:
// Execution.
virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
DEFINE_STANDARD_RTTIEXT(ConeDriver, TFunction_Driver)
DEFINE_STANDARD_RTTIEXT(ConeDriver, BaseDriver)
};
#endif // !defined(_CONEDRIVER_H_)

View File

@@ -30,7 +30,7 @@ public:
// Execution.
virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
DEFINE_STANDARD_RTTIEXT(CylinderDriver, TFunction_Driver)
DEFINE_STANDARD_RTTIEXT(CylinderDriver, BaseDriver)
};
#endif // !defined(_CYLINDERDRIVER_H_)

View File

@@ -30,7 +30,7 @@ public:
// Execution.
virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
DEFINE_STANDARD_RTTIEXT(PointDriver, TFunction_Driver)
DEFINE_STANDARD_RTTIEXT(PointDriver, BaseDriver)
};
#endif // !defined(_PointDRIVER_H_)

View File

@@ -30,7 +30,7 @@ public:
// Execution.
virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
DEFINE_STANDARD_RTTIEXT(PrismDriver, TFunction_Driver)
DEFINE_STANDARD_RTTIEXT(PrismDriver, BaseDriver)
};
#endif // !defined(_PRISMDRIVER_H_)

View File

@@ -30,7 +30,7 @@ public:
// Execution.
virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
DEFINE_STANDARD_RTTIEXT(ShapeSaverDriver, TFunction_Driver)
DEFINE_STANDARD_RTTIEXT(ShapeSaverDriver, BaseDriver)
};
#endif // !defined(_SHAPESAVERDRIVER_H_)