<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 - Clang-Format ignores disabled conditional preprocessor blocks"
   href="https://bugs.llvm.org/show_bug.cgi?id=39255">39255</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang-Format ignores disabled conditional preprocessor blocks
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>Formatter
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>Bumblebritches57@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>preprocessor blocks aren't formatted properly at all.

Example:

Before:

#if (defined(__UNIX__))
#define _FILE_OFFSET_BITS 64
#elif (defined _WIN32)
#define _UNICODE
#endif

After:
#if   (defined(__UNIX__))
# define _FILE_OFFSET_BITS 64
#elif (defined _WIN32)
#define _UNICODE
#endif

and let's say we're compiling on a UNIX platform, so the first branch of the
preprocessor directive is enabled, but not the second.

Only the enabled block would actually be formatted, the disabled block is
completely ignored.

I'm not sure if this is just because the formatter is running after the
preprocessor, or if it's a lot deeper than that, and Clang is removing the
unavailable preprocessor tokens before anyone else has access to it?</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>