<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - Empty macro expansion from inside another macro causes incorrect placement of expanded macro"
   href="http://llvm.org/bugs/show_bug.cgi?id=18485">18485</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Empty macro expansion from inside another macro causes incorrect placement of expanded macro
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>eremeev@viva64.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Empty macro expansion from inside another macro causes incorrect placement of
expanded macro.
Consider the example:

#define B

#define A(type) B unsigned type
/*
empty lines
...
...
...
...*/
A(int) foo()
{}

The clang preprocessor (-E option) will output the following:

#line 1 "D:/home/paul/sample.c"
#line 1 "<built-in>"
#line 1 "<built-in>"
#line 156 "<built-in>"
#line 1 "<command line>"
#line 1 "<built-in>"
#line 1 "D:/home/paul/sample.c" unsigned int
#line 10 "D:/home/paul/sample.c"
       foo()
{}

Take a note, that the return type of the foo function is placed before #line
10, meaning that it is placed before the whitespace, thus incorrectly pointing
the start position of the foo to line 1 instead of line 10.</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>