[Bug preprocessor/57824] Raw string literals not handled correctly in macro arguments or deferred pragmas

moritz.baumann at sap dot com gcc-bugzilla@gcc.gnu.org
Tue Jul 27 14:14:44 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57824

Moritz Baumann <moritz.baumann at sap dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |moritz.baumann at sap dot com

--- Comment #4 from Moritz Baumann <moritz.baumann at sap dot com> ---
Raw string literals are still not handled correctly in macros in some cases:

#define myMacro(string) u##string

int square(int num) {
    auto string = myMacro(R"EOF(



    )EOF");
    // intentional syntax error
    return num * num
}

(https://godbolt.org/z/qYfax5E8x)

The line number in the compiler error message refers to a line that doesn't
even exist. It seems like line breaks in the raw string literal are counted
twice.


More information about the Gcc-bugs mailing list