warn_hidevirtual. NXP CodeWarrior Development Studio
Annons
Annons
warn_hidevirtual
NOTE
When an exception is thrown from a static local initializer, the initializer is retried by the next client that enters the scope of the local.
This pragma does not correspond to any panel setting. By default, this pragma is off
.
29.43 warn_hidevirtual
Controls the recognition of a non-virtual member function that hides a virtual function in a superclass.
Syntax
#pragma warn_hidevirtual on | off | reset
Remarks
If you enable this pragma, the compiler issues a warning message if you declare a nonvirtual member function that hides a virtual function in a superclass. One function hides another if it has the same name but a different argument type.
shows an example.
Listing 29-14. Hidden Virtual Functions
class A {
public:
virtual void f(int);
virtual void g(int);
}; class B: public A {
public:
void f(char); // WARNING: Hides A::f(int)
virtual void g(int); // OK: Overrides A::g(int)
};
The ISO/IEC 14882:2003 C++ Standard does not require this pragma.
NOTE
A warning message normally indicates that the pragma name is not recognized, but an error indicates either a syntax problem or that the pragma is not valid in the given context.
This pragma corresponds to the Hidden Virtual Functions setting in the CodeWarrior
IDE's Properties > C/C++ Build > Settings > Tool Settings > PowerPC Compiler >
Warniings C/C++ Language settings panel.
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
454 Freescale Semiconductor, Inc.
Ladda ner
Annons