public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "markmigm at gmail dot com" <gcc-bugzilla@gcc.gnu.org> 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 [thread overview] Message-ID: <bug-103499-4-VNjgoXOoGK@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103499-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103499 Mark Millard <markmigm at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |markmigm at gmail dot com --- Comment #1 from Mark Millard <markmigm at gmail dot com> --- I see this in G++ 12.2.0 on FreeBSD. Reduced to a small example below. Compiled via: // g++12 -std=c++20 -fmodules-ts -xc++-system-header type_traits // g++12 -std=c++20 -fmodules-ts -xc++ -c gpp12_module_iostream_failure.cppm // g++12 -freport-bug -std=c++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 = 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=/usr/local/lib/gcc12 --libexecdir=/usr/local/libexec/gcc12 --program-suffix=12 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc12/include/c++/ --with-gxx-libcxx-include-dir=/usr/include/c++/v1 --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --without-zstd --enable-languages=c,c++,objc,fortran,jit --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --infodir=/usr/local/share/info/gcc12 --build=aarch64-portbld-freebsd14.0 // Thread model: posix // Supported LTO compression algorithms: zlib // gcc version 12.2.0 (FreeBSD Ports Collection) // // 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<class _Tp, class ... _Args> using __is_nothrow_constructible_impl = std::__bool_constant<__is_nothrow_constructible(_Tp)> [with _Tp = derived@derived_interface; _Args = {}]': // /usr/local/lib/gcc12/include/c++/type_traits:1047:12: required from 'struct std::is_nothrow_constructible<derived@derived_interface>' // /usr/local/lib/gcc12/include/c++/type_traits:3243:46: required from 'constexpr const bool std::is_nothrow_constructible_v<derived@derived_interface>' // gpp12_module_is_nothrow_constructible_v_failure.cpp:11:11: required from 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: declared 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=lp64 -std=c++20 -freport-bug -fmodules-ts -o - -frandom-seed=0 -fdump-noaddr # 0 "gpp12_module_is_nothrow_constructible_v_failure.cpp" # 0 "<built-in>" # 0 "<command-line>" # 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<derived>); }
next prev parent reply other threads:[~2022-09-02 20:28 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-30 16:35 [Bug c++/103499] New: " oleg at smolsky dot net 2022-09-02 20:28 ` markmigm at gmail dot com [this message] 2022-09-03 20:43 ` [Bug c++/103499] " markmigm at gmail dot com 2022-09-08 4:58 ` markmigm at gmail dot com 2023-06-02 19:27 ` pinskia at gcc dot gnu.org 2023-06-05 8:38 ` redi at gcc dot gnu.org 2023-06-05 13:44 ` markmigm at gmail dot com 2023-11-14 19:43 ` cvs-commit at gcc dot gnu.org 2024-02-10 4:32 ` nshead at gcc dot gnu.org 2024-03-08 16:03 ` ppalka at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-103499-4-VNjgoXOoGK@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).