From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9A5403858C53; Fri, 2 Sep 2022 20:28:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A5403858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662150534; bh=ZnmOSDfEP1WGjttZa8bDubDw5rxZr8sHjG6p3kxRvkw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ybMzB9nj2y7bQFqbmS6osOXC26pny3TRcPkl2G5A7yIOJRHNVLpfi7jHRS3757mys +biR+hXy+9PzV6Ldn15HjOneNKu9l0GrZ903URXksNV4U5QoOahMXMZLnKwwSRdBFB mVaewlVzK87pb2iV1nQGpc4uhEkiFtC0uq0oRqrM= From: "markmigm at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103499] C++20 modules error: invalid use of non-static member function Date: Fri, 02 Sep 2022 20:28:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: markmigm 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: cc Message-ID: In-Reply-To: References: 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=3D103499 Mark Millard changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |markmigm at gmail dot com --- Comment #1 from Mark Millard --- I see this in G++ 12.2.0 on FreeBSD. Reduced to a small example below. Compiled via: // g++12 -std=3Dc++20 -fmodules-ts -xc++-system-header type_traits // g++12 -std=3Dc++20 -fmodules-ts -xc++ -c gpp12_module_iostream_failure.c= ppm // g++12 -freport-bug -std=3Dc++20 -fmodules-ts -c gpp12_module_iostream_failure.cpp # more gpp12_module_is_nothrow_constructible_v_failure.cppm export module derived_interface; export struct base { virtual ~base() noexcept =3D default; }; export struct derived : base { }; # more /tmp/ccrTCTqv.out // Target: aarch64-portbld-freebsd14.0 // Configured with: /wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/configure --disable-multilib --disable-bootstrap --disable-nls --enable-gnu-indirect-function --enable-host-shared --enable-plugin --libdir=3D/usr/local/lib/gcc12 --libexecdir=3D/usr/local/libexec/gcc12 --program-suffix=3D12 --with-as=3D/usr/local/bin/as --with-gmp=3D/usr/local --with-gxx-include-dir=3D/usr/local/lib/gcc12/include/c++/ --with-gxx-libcxx-include-dir=3D/usr/include/c++/v1 --with-ld=3D/usr/local/= bin/ld --with-pkgversion=3D'FreeBSD Ports Collection' --with-system-zlib --without= -zstd --enable-languages=3Dc,c++,objc,fortran,jit --prefix=3D/usr/local --localstatedir=3D/var --mandir=3D/usr/local/man --infodir=3D/usr/local/share/info/gcc12 --build=3Daarch64-portbld-freebsd14= .0 // Thread model: posix // Supported LTO compression algorithms: zlib // gcc version 12.2.0 (FreeBSD Ports Collection)=20 //=20 // In module /usr/local/lib/gcc12/include/c++/type_traits, imported at gpp12_module_is_nothrow_constructible_v_failure.cpp:7: // /usr/local/lib/gcc12/include/c++/type_traits: In substitution of 'template using __is_nothrow_constructible_impl= =3D std::__bool_constant<__is_nothrow_constructible(_Tp)> [with _Tp =3D derived@derived_interface; _Args =3D {}]': // /usr/local/lib/gcc12/include/c++/type_traits:1047:12: required from 'struct std::is_nothrow_constructible' // /usr/local/lib/gcc12/include/c++/type_traits:3243:46: required from 'constexpr const bool std::is_nothrow_constructible_v' // gpp12_module_is_nothrow_constructible_v_failure.cpp:11:11: required fr= om here // /usr/local/lib/gcc12/include/c++/type_traits:1041:11: error: invalid use= of non-static member function 'virtual constexpr derived@derived_interface::~derived()' // 1041 | using __is_nothrow_constructible_impl // | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // In module derived_interface, imported at gpp12_module_is_nothrow_constructible_v_failure.cpp:5: // gpp12_module_is_nothrow_constructible_v_failure.cppm:10:15: note: declar= ed here // 10 | export struct derived : base // | ^~~~~~~ // /usr/local/lib/gcc12/include/c++/type_traits:1041: confused by earlier errors, bailing out // /usr/local/libexec/gcc12/gcc/aarch64-portbld-freebsd14.0/12.2.0/cc1plus -quiet gpp12_module_is_nothrow_constructible_v_failure.cpp -quiet -dumpbase gpp12_module_is_nothrow_constructible_v_failure.cpp -dumpbase-ext .cpp -mlittle-endian -mabi=3Dlp64 -std=3Dc++20 -freport-bug -fmodules-ts -o - -frandom-seed=3D0 -fdump-noaddr # 0 "gpp12_module_is_nothrow_constructible_v_failure.cpp" # 0 "" # 0 "" # 1 "gpp12_module_is_nothrow_constructible_v_failure.cpp" import derived_interface; import "/usr/local/lib/gcc12/include/c++/type_traits"; void test() { if (std::is_nothrow_constructible_v); }=