MISRAC++2008-2-13-5
In this section:
Synopsis
(Required) Narrow and wide string literals shall not be concatenated.
Enabled by default
Yes
Severity/Certainty
Medium/Medium

Full description
String literals with different suffixes concatenated. This check is identical to MISRAC++2023-5.13.7.
Coding standards
- MISRA C++ 2023 5.13.7
(Required) String literals with different encoding prefixes shall not be concatenated
Code examples
The following code example fails the check and will give a warning:
void example() {
const char* s = u8"Hello" "World";
}
The following code example passes the check and will not give a warning about this issue:
void example() {
const char * s = u8"Hello" u8"World";
}