From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BC9693865488; Tue, 26 Jan 2021 23:35:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC9693865488 From: "gcc at boltav dot me.uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98843] New: Building simple c++ modules example fails but successful with -save-temps Date: Tue, 26 Jan 2021 23:35:52 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gcc at boltav dot me.uk 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 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2021 23:35:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98843 Bug ID: 98843 Summary: Building simple c++ modules example fails but successful with -save-temps Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc at boltav dot me.uk Target Milestone: --- Checked out and built: g++ (GCC) 11.0.0 20210125 (experimental) @ commit a61efd469371b71483d42afa1038e6a8c16baf4a (HEAD -> master, origin/master, origin/HEAD) When I try to build the sources below, the build fails. However when I add= ed -save-temps for this bug report the build succeeded! sources below from https://vector-of-bool.github.io/2019/03/10/modules-1.ht= ml source - mod.cpp export module speech; export const char* get_phrase() { return "Hello, world!"; } source - main.cpp // main.cpp import speech; import ; int main() { std::cout << get_phrase() << '\n'; } Commands for build: g++ --version g++ -c -std=3Dc++20 -fmodules-ts -o mod.o ../src/mod.cpp g++ -std=3Dc++20 -fmodules-ts -x c++-system-header iostream g++ -c -std=3Dc++20 -fmodules-ts -o main.o ../src/main.cpp Diagnostic: g++ (GCC) 11.0.0 20210125 (experimental) Copyright =C2=A9 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =E2=80=98 In file included from /home/gary/Projects/g++mod/install/20210125/include/c++/11.0.0/bits/ios_bas= e.h:46, from /home/gary/Projects/g++mod/install/20210125/include/c++/11.0.0/ios:42, from /home/gary/Projects/g++mod/install/20210125/include/c++/11.0.0/ostream:38, from /home/gary/Projects/g++mod/install/20210125/include/c++/11.0.0/iostream:39, of module /home/gary/Projects/g++mod/install/20210125/include/c++/11.0.0/iostream, imported at /home/gary/Projects/module-test/builds/../src/main.cpp:4: in import_entity_module, at cp/module.cc:4083 189 | template for instructions. Build dir layout after (because modules): $ tree . =E2=94=9C=E2=94=80=E2=94=80 gcm.cache =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 home =E2=94=82=C2=A0=C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 gary =E2=94=82=C2=A0=C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80= Projects =E2=94=82=C2=A0=C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2= =94=80 g++mod =E2=94=82=C2=A0=C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80= =E2=94=80 install =E2=94=82=C2=A0=C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94= =80=E2=94=80 20210125 =E2=94=82=C2=A0=C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94=94= =E2=94=80=E2=94=80 include =E2=94=82=C2=A0=C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94= =94=E2=94=80=E2=94=80 c++ =E2=94=82=C2=A0=C2=A0 =E2=94=82=C2=A0=C2=A0 =E2= =94=94=E2=94=80=E2=94=80 11.0.0 =E2=94=82=C2=A0=C2=A0 =E2=94=82=C2=A0=C2=A0 = =E2=94=94=E2=94=80=E2=94=80 iostream.gcm =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 speech.gcm =E2=94=9C=E2=94=80=E2=94=80 mod.o =E2=94=94=E2=94=80=E2=94=80 mods.sh System: Linux 5.4.0-64-generic #72~18.04.1-Ubuntu SMP Fri Jan 15 14:06:34 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Version and options: =E2=86=92 g++ -v Using built-in specs. COLLECT_GCC=3Dg++ COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=3Dnvptx-none OFFLOAD_TARGET_DEFAULT=3D1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=3Dfile:///usr/share/doc/gcc-7/README.Bu= gs --enable-languages=3Dc,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=3D/u= sr --with-gcc-major-version-only --program-suffix=3D-7 --program-prefix=3Dx86_64-linux-gnu- --enable-shared --enable-linker-build-= id --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --libdir=3D/usr/lib --enable-nls --enable-bootstrap --enable-clocale=3Dgnu --enable-libstdcxx-debug --enable-libstdcxx-time=3Dyes --with-default-libstdcxx-abi=3Dnew --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=3Dauto --enable-multiarch --disable-werror --with-arch-32=3Di686 --with-abi=3Dm64 --with-multilib-list=3Dm32,m64,mx32 --enable-multilib --with-tune=3Dgeneric --enable-offload-targets=3Dnvptx-none --without-cuda-driver --enable-checking=3Drelease --build=3Dx86_64-linux-gnu --host=3Dx86_64-linu= x-gnu --target=3Dx86_64-linux-gnu Thread model: posix gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)=