JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.0p0 Hot Tips | CONFIDENTIAL | CodeSecure Inc |
A class is derived from a virtual stateful base class through indirect inheritance only.
We say a class is stateful if it has at least one data member.
This class is a strict subset of Virtual Base Class.
| クラス名 | Implicit Inheritance from Stateful Virtual Base | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | Implicit Inheritance from Stateful Virtual Base | ||||||||||||
| クラス分類 | スタイル (style) | ||||||||||||
| ニーモニック | LANG.TYPE.IISVB | ||||||||||||
| カテゴリー |
|
||||||||||||
| 対応言語 | C++ のみ利用可能です。 C は利用できません。 |
||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで無効になっており、プロジェクトには非正規の C向けAST
が必要になります。有効にするにはプロジェクト設定ファイル (configuration file) に以下の WARNING_FILTER ルールと
RETAIN_UNNORMALIZED_C_AST 設定を追加してください。
RETAIN_UNNORMALIZED_C_AST = Yes WARNING_FILTER += allow class="Implicit Inheritance from Stateful Virtual Base" |
struct A { int a; }; // A has a data member so is considered "stateful".
struct B : virtual A {};
struct C : virtual A {};
struct D : B {}; // 'Implicit Inheritance from Stateful Virtual Base' warning issued here
// - inherits 'virtual A' indirectly only
struct E: C, virtual A {}; // ok: inherits 'virtual A' directly (and indirectly)
struct F : D, E {}; // 'Implicit Inheritance from Stateful Virtual Base' warning issued here
// - inherits 'virtual A' indirectly but not directly
struct G : D, E, virtual A {}; // ok: inherits 'virtual A' directly (and indirectly)
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。