https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118599
Bug ID: 118599
Summary: Incorrect diagnostic on multiline string literal
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: egor.pugin at gmail dot com
Target Milestone: ---
https://godbolt.org/z/8oTdbx4bf
Consider the following:
#include <iostream>
int main() {
std::cerr << "1st line\m"
"2nd line\n";
}
gcc incorrectly gives:
<source>: In function 'int main()':
<source>:5:18: warning: unknown escape sequence: '\m'
5 | "2nd line\n";
| ^~~~~~~~~~~~
clang correctly gives:
<source>:4:27: warning: unknown escape sequence '\m'
[-Wunknown-escape-sequence]
4 | std::cerr << "1st line\m"
| ^~