https://llvm.org/bugs/show_bug.cgi?id=31905

            Bug ID: 31905
           Summary: [modules] #include "stddef.h" breaks module map search
                    paths; causes redefinitions.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Modules
          Assignee: unassignedclangb...@nondot.org
          Reporter: e...@efcs.ca
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
    Classification: Unclassified

Created attachment 17951
  --> https://llvm.org/bugs/attachment.cgi?id=17951&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to