<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 - frewrite-imports not usable with umbrella directory declarations"
   href="https://bugs.llvm.org/show_bug.cgi?id=39682">39682</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>frewrite-imports not usable with umbrella directory declarations
          </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>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>Modules
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>foo.h:
  // empty
use.cpp:
  #include "foo.h"
  // empty
module.modulemap:
  module A {
    umbrella "."
    module * { export * }
  }

$ clang++ -fmodules -c -xc++ -Xclang -emit-module -fmodule-name=A
module.modulemap -o A.pcm
$ clang++ -fmodules -fmodule-file=A.pcm use.cpp -frewrite-imports -E -o x.cpp
$ clang++-tot -fmodules x.cpp
<module-includes>:1:30: error: submodule A.'foo' not declared in module map
#pragma clang module begin A.foo
                             ^
While building module 'A' imported from x.cpp:1:
In file included from <module-includes>:2:
././foo.h:1:22: error: no matching '#pragma clang module begin' for this
'#pragma clang module end'
#pragma clang module end /*A.foo*/
                     ^
use.cpp:1:29: fatal error: module 'A' not found
#pragma clang module import A.foo /* clang -frewrite-includes: implicit import
*/
                     ~~~~~~~^
3 errors generated.



Richard mentioned that the expectation is that the modulemap written to the
rewrite-imports output file should contain the "module * { export * }" expanded
across the files, so it no longer contains the * globs.

For example, if the x.cpp is manually modified, replacing "module * { export *
}" with "module foo { export foo }" this does produce a file that
parses/compiles without error.</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>