[llvm-bugs] [Bug 39682] New: frewrite-imports not usable with umbrella directory declarations
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Nov 15 16:00:35 PST 2018
https://bugs.llvm.org/show_bug.cgi?id=39682
Bug ID: 39682
Summary: frewrite-imports not usable with umbrella directory
declarations
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Modules
Assignee: unassignedclangbugs at nondot.org
Reporter: dblaikie at gmail.com
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181116/ffe7fdf0/attachment.html>
More information about the llvm-bugs
mailing list