From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 18E143858D39; Mon, 27 Mar 2023 10:03:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 18E143858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679911394; bh=9jq+xz7bPXNzugkRjEEvF4A8+Ed+LqcEdkRst2dkaIc=; h=From:To:Subject:Date:From; b=Rz/vNoUy+uzWjpR4hAYyqz3bSOIRehcEVTyVeRady+ewkLtBIP7hWnBZNHN7XHkP7 fJd++m1WAIx8M5Y2r6UUEhOxZj60vzYeDGOlcUNoF+YwKM75OaqCnqfIM/VquzpXYC 2rGr0ZH/0fQIEXWCutNZ1ajn1qEvCV24yk4MTw5E= From: "matthewsatti at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109295] New: deducing brace-enclosed initializer list using import fails to compile Date: Mon, 27 Mar 2023 10:03:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: matthewsatti at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109295 Bug ID: 109295 Summary: deducing brace-enclosed initializer list using import fails to compile Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matthewsatti at gmail dot com Target Milestone: --- Created attachment 54765 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54765&action=3Dedit pre-processed file using -save-temps Hello, I've been experimenting with C++20 modules and came across the following is= sue. Given the program: import ; int main() { auto values =3D {1, 2, 3}; return 0; } and trying to compile with these commands: g++ -std=3Dc++20 -Wall -Wextra -fmodules-ts -x c++-system-header initialize= r_list g++ -std=3Dc++20 -Wall -Wextra -fmodules-ts main.cxx -o main produces the compile error: main.cxx: In function =E2=80=98int main()=E2=80=99: main.cxx:4:31: error: deducing from brace-enclosed initializer list requires =E2=80=98#include =E2=80=99 1 | import ; +++ |+#include 2 |=20 3 | int main() { 4 | auto values =3D {1, 2, 3}; | ^ My assumption is that import ; should have worked? gcc -v output: Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --enable-languages=3Dc,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-boots= trap --prefix=3D/usr --libdir=3D/usr/lib --libexecdir=3D/usr/lib --mandir=3D/usr= /share/man --infodir=3D/usr/share/info --with-bugurl=3Dhttps://bugs.archlinux.org/ --with-build-config=3Dbootstrap-lto --with-linker-hash-style=3Dgnu --with-system-zlib --enable-__cxa_atexit --enable-cet=3Dauto --enable-checking=3Drelease --enable-clocale=3Dgnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-obj= ect --enable-libstdcxx-backtrace --enable-link-serialization=3D1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=3Dposix --disable-libssp --disable-libstdc= xx-pch --disable-werror Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.2.1 20230201 (GCC) I have also attached the pre-processed output=