[Bug 264730] clang++ -fmodules fails when using stdout from cstdio: error: declaration of '__stdoutp' must be imported from module 'std.iosfwd' before it is required

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 18 Jun 2022 13:55:26 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264730

--- Comment #2 from Dimitry Andric <dim@FreeBSD.org> ---
This appears to fix it:

--- /usr/include/c++/v1/module.modulemap.org    2022-01-07 17:11:14.993926000
+0100
+++ /usr/include/c++/v1/module.modulemap        2022-06-18 15:52:04.275940000
+0200
@@ -180,7 +180,7 @@
       export *
     }
     module cstdio {
-      header "cstdio"
+      textual header "cstdio"
       export *
     }
     module cstdlib {

E.g. I looked at the module for <stdio.h>, and that has a comment:

    module stdio_h {
      // <stdio.h>'s __need_* macros require textual inclusion.
      textual header "stdio.h"
      export *
      export Darwin.C.stdio
    }

We don't have "__need_*" macros, but equivalent _*_DEFINED and _*_DECLARED
ones.

It looks like clang modules can't work yet without the "textual" keyword on a
bunch of our headers...

-- 
You are receiving this mail because:
You are the assignee for the bug.