<html>
    <head>
      <base href="https://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 --- - [modules] #include "stddef.h" breaks module map search paths; causes redefinitions."
   href="https://llvm.org/bugs/show_bug.cgi?id=31905">31905</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[modules] #include "stddef.h" breaks module map search paths; causes redefinitions.
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>Modules
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>eric@efcs.ca
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17951" name="attach_17951" title="full reproducer.">attachment 17951</a> <a href="attachment.cgi?id=17951&action=edit" title="full reproducer.">[details]</a></span>
full reproducer.

Currently including "stddef.h" or other builtin headers when modules is enabled
causes Clang to find `module.modulemap` files along the wrong search paths. For
example, given the following configuration:

1) A project "my_project" which provides a module map for its headers.

2) The system has an installation of "my_project" in
"/usr/local/include/my_project".

3) A user has a local development copy of "my_project" that they are trying to
compile.

While compiling the local copy both the in-tree and system installed
module.modulemap are along the header include paths, however the local copy has
precedence and that's the module.modulemap Clang initially selects.

However after Clang processes a `#include "stddef.h"` it will end up processing
`/usr/local/include/my_project/module.modulemap`. This causes module
re-definition compile errors.

This bug is currently preventing LLVM from installing it's module maps, because
this bug will be hit when re-compiling LLVM.</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>