https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264730
Bug ID: 264730
Summary: clang++ -fmodules fails when using stdout from cstdio:
error: declaration of '__stdoutp' must be imported
from module 'std.iosfwd' before it is required
Product: Base System
Version: 13.1-RELEASE
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: [email protected]
Reporter: [email protected]
While trying to figure out a build failure for an LLDB test, I've noticed a
problem with clang++ on FreeBSD. The minimal reproducer is:
```
#include <cstdio>
int main() {
std::FILE* f = stdout;
return 0;
}
```
Building with -fmodules fails:
```
$ clang++ -fmodules /tmp/test.cxx
/tmp/test.cxx:4:18: error: declaration of '__stdoutp' must be imported from
module 'std.iosfwd' before it is required
std::FILE* f = stdout;
^
/usr/include/stdio.h:241:16: note: expanded from macro 'stdout'
#define stdout __stdoutp
^
/usr/include/wchar.h:184:14: note: declaration here is not visible
extern FILE *__stdoutp;
^
1 error generated.
```
The same sample works on Linux (w/ libc++). I suspect the problem lies
somewhere in FreeBSD headers.
I can also reproduce with git clang (built from
1e67385d28a4462b3badb40373cd05d91f8ebce5) but against system libc++.
--
You are receiving this mail because:
You are the assignee for the bug.