☰
  • 首页
  • 规则分类
  • 项目介绍
search
•••

非空源文件未以换行符结尾,或以换行符结尾但换行符之前是反斜杠

C++-Undefined-Behavior-2
目录 › next › previous

示例:

namespace NS {
    ....
}\                 // Undefined behavior if this is the last line

C++03 声明了这种情况会导致未定义的行为,C++11 规定在这种情况下编译器应补全所需的空行。

依据

ISO/IEC 14882:2003 2.1(2)-undefined

规则

ID_missingNewLineFileEnd ID_badBackslash
Copyright©2024 360 Security Technology Inc., Licensed under the Apache-2.0 license.