From nobody Fri Jun 17 07:08:27 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1384783DB40 for ; Fri, 17 Jun 2022 07:08:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LPVWH698Kz3qy0 for ; Fri, 17 Jun 2022 07:08:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B053E1B2FE for ; Fri, 17 Jun 2022 07:08:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 25H78RCF099575 for ; Fri, 17 Jun 2022 07:08:27 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 25H78RCP099574 for bugs@FreeBSD.org; Fri, 17 Jun 2022 07:08:27 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [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 Date: Fri, 17 Jun 2022 07:08:27 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: mgorny@gentoo.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655449707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2KZbI45FlSKjwv2LaICURr3sxwqpPaepOID7YN70K/o=; b=HabA1TlG2eE1fAO36+fIPQmAbz5GHAUrpls0wRIy8fOXIItCx78bRxOgldYF5PhiQi4YbO oNHPd2FVDRV8bl8Zm0MUWPG2cw/4miwZY1A/36x1hdISqnkbN0i4dzsgTdHrLWKwyUBddd /x52AI88JWxp703UYCWG7VCbmlRq4Z1pO9PYJkr9ZIIOuAv1oVch4EvO2x1fd56zewRb3p n0wtPsiumlPEMmswwgBVh2MT3aH8lJZKTRHDKmuGHgEcdExVrHhp034UOo5ADhSy/D2eiH ZyRDFHZE7372crjLcRpm2hdSlQCrmBWUReJ5bXlRr1w0bimkqx0XWMlYL1OGMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655449707; a=rsa-sha256; cv=none; b=I7NwiYUA9CKLeVzz3lH+kGzHeGVvChXiD67zQfHMQGK4n3JEm/nSHNpiL+AQmm5fArH2tw gHWA2pZjNocVmK8Tx0WPOBub38Yt1K2IUqM02IoXXM6GEwz08iSLyTyWmI0olNAqe478TT b3ltui+kUKCOgEN8Iqrky8y6EkrkkblGp1/4ZVL7/CFX7rHM3G7j3auHtzMw+dTtEayzjO e1MwGZNcSovhCru+tqvoRkhyEEdUtWqJS8fPkb8zKfXhLffHYGAhlTdWaF7OVfemJZOop+ ftHMS35sTt0M3bdh7khBT/uvmWnZrsTyTLPidgNVDkVG1ySVP+hRQiteZmWANA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264730 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: bugs@FreeBSD.org Reporter: mgorny@gentoo.org 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 int main() { std::FILE* f =3D stdout; return 0; } ``` Building with -fmodules fails: ``` $ clang++ -fmodules /tmp/test.cxx=20 /tmp/test.cxx:4:18: error: declaration of '__stdoutp' must be imported from module 'std.iosfwd' before it is required std::FILE* f =3D 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++. --=20 You are receiving this mail because: You are the assignee for the bug.=