AutosarC++17_10-A2.8.1ΒΆ
The character shall not occur as a last character of a C++ comment
Required inputs: IR
Bad code (line splicing in comment):
// This is a comment that continues \ int x = 5; // Error: This becomes part of the comment due to line-splicing!
Good code (proper multi-line comment):
// This is a comment that continues // to the next line with a fresh comment int x = 5; // OK: properly formed
Good code (using block comment):
/* This is a multi-line comment that spans multiple lines cleanly without confusion */ int x = 5; // OK: clear and unambiguous
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
line_splicing_in_cpp_comment |
Line-splicing shall not be used in // comments. |
None |
False |
Options
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
This rule has no individual options.