<html>
    <head>
      <base href="http://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 - undef is printed on the wrong line by -E -CC -dD with comment in macro"
   href="http://bugs.llvm.org/show_bug.cgi?id=32631">32631</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>undef is printed on the wrong line by -E -CC -dD with comment in macro
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>4.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>jonathanmueller.dev@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If you run `clang++ -E -CC -dD` on this file:

```
#define FOO /*a
b
c*/

FOO

#undef FOO
```

The output is:

```
predefine macros here...

# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "file.cpp" 2
#define FOO /*a
b
c*/



/*a
b
c*/#undef FOO
# 7 "file.cpp"


```

This is incorrect, the `#undef` is on the same line as the expansion but should
be on its own line.
The error still happens when the macro contains additional code, but doesn't
happen anymore if it contains a comment with a line number other than three.

I know that this is *really* obscure, but I parse the output of `clang++ -E`
and can't detect the `#undef` if it is on the same line.</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>