<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - After r303589, Assertion failed: (0 <= N && N < static_cast<int>(m_byteToColumn.size())), function byteToContainingColumn, file tools/clang/lib/Frontend/TextDiagnostic.cpp, line 281."
   href="https://bugs.llvm.org/show_bug.cgi?id=33902">33902</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>After r303589, Assertion failed: (0 <= N && N < static_cast<int>(m_byteToColumn.size())), function byteToContainingColumn, file tools/clang/lib/Frontend/TextDiagnostic.cpp, line 281.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dimitry@andric.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I recently imported llvm/clang trunk r308421 into FreeBSD 12-CURRENT, and
afterwards, I got a report [1] that building the graphics/libchamplain port
lead to an assertion failure:

Assertion failed: (0 <= N && N < static_cast<int>(m_byteToColumn.size())),
function byteToContainingColumn, file
/poudriere/jails/head-amd64/usr/src/contrib/llvm/tools/clang/lib/Frontend/TextDiagnostic.cpp,
line 281.

Bisection shows this assertion failure has been introduced by r303589. 
Minimized test case:

#define a(b) #b
#define c(d) _Pragma(a(d))
#define e(f) c(GCC warning #f)
e() e()

Output of clang r303588:

    testcase.c:4:1: warning:  [-W#pragma-messages]
    e() e()
    ^
    testcase.c:3:14: note: expanded from macro 'e'
    #define e(f) c(GCC warning #f)
                 ^
    testcase.c:2:14: note: expanded from macro 'c'
    #define c(d) _Pragma(a(d))
                 ^
    <scratch space>:4:6: note: expanded from here
     GCC warning ""
         ^
    testcase.c:4:5: warning:  [-W#pragma-messages]
    e() e()
        ^
    testcase.c:3:14: note: expanded from macro 'e'
    #define e(f) c(GCC warning #f)
                 ^
    testcase.c:2:14: note: expanded from macro 'c'
    #define c(d) _Pragma(a(d))
                 ^
    <scratch space>:5:6: note: expanded from here
     GCC warning ""
         ^
    2 warnings generated.

Output of clang r303589:

    testcase.c:4:1: warning:  [-W#pragma-messages]
    e() e()
    ^
    testcase.c:3:14: note: expanded from macro 'e'
    #define e(f) c(GCC warning #f)
                 ^
    testcase.c:2:14: note: expanded from macro 'c'
    #define c(d) _Pragma(a(d))
                 ^
    <scratch space>:4:6: note: expanded from here
     GCC warning ""
         ^
    testcase.c:4:5: warning:  [-W#pragma-messages]
    e() e()
        ^
    testcase.c:3:14: note: expanded from macro 'e'
    #define e(f) c(GCC warning #f)
                 ^
    testcase.c:2:14: note: expanded from macro 'c'
    #define c(d) _Pragma(a(d))
                 ^
    <scratch space>:5:6: note: expanded from here
    Assertion failed: (0 <= N && N < static_cast<int>(m_byteToColumn.size())),
function byteToContainingColumn, file
/home/dim/src/llvm-trunk/tools/clang/lib/Frontend/TextDiagnostic.cpp, line 281.

[1]
<a href="http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p446433_s321376/logs/errors/libchamplain-0.12.15.log">http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p446433_s321376/logs/errors/libchamplain-0.12.15.log</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>