[llvm-bugs] [Bug 48233] New: Incorrect line numbers with -E and raw string

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 19 11:03:12 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48233

            Bug ID: 48233
           Summary: Incorrect line numbers with -E and raw string
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: stevecor at bullseye.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 24187
  --> https://bugs.llvm.org/attachment.cgi?id=24187&action=edit
Example source file as described

Line numbers in the preprocessor output are incorrect when a source has a raw
string literal containing newlines.

Consider this source file containing these three lines:

    const char s[] = R"(line1
        line2)";
    int line3;

Preprocess this source with -E:

    $ clang++ -E bug.cpp

The output ends like below. There is an incorrect extra blank line following
the raw string.

    # 1 "bug.cpp" 2
    const char s[] = R"(line1       <-- line 1, correct
        line2)";                    <-- line 2, correct
                                    <-- incorrect extra blank line
    int line3;                      <-- line 4, incorrect should be line 3

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201119/fda684e2/attachment.html>


More information about the llvm-bugs mailing list