MISRA C++:2008 Rule 7-3-6
using-directives and using-declarations (excluding class scope or function scope using-declarations) shall not be used in header files
説明
ルール定義
using-directives and using-declarations (excluding class scope or function scope using-declarations) shall not be used in header files. 1
根拠
using 命令または宣言がヘッダー ファイル内に存在する場合は、ヘッダーのインクルード順序が最終的なプログラム結果に影響する可能性があります。プログラムの動作がヘッダーのインクルード順序に依存しないことを確認することをお勧めします。
Polyspace 実装
チェッカーは、ヘッダー ファイル内の using 命令または宣言にフラグを設定します。
トラブルシューティング
ルール違反が想定されるものの、Polyspace® から報告されない場合は、コーディング規約違反が想定どおりに表示されない理由の診断を参照してください。
例
チェック情報
| グループ: Declarations |
| カテゴリ: 必要 |
バージョン履歴
R2013b で導入
1 All MISRA coding rules and directives are © Copyright The MISRA Consortium Limited 2021.
The MISRA coding standards referenced in the Polyspace Bug Finder™ documentation are from the following MISRA standards:
MISRA C:2004
MISRA C:2012
MISRA C:2023
MISRA C++:2008
MISRA C++:2023
MISRA and MISRA C are registered trademarks of The MISRA Consortium Limited 2021.