public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "StevenSun2021 at hotmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101681] PMF comparison to nullptr is not considered a constexpr Date: Sat, 07 Aug 2021 00:43:14 +0000 [thread overview] Message-ID: <bug-101681-4-A3bmwFOBT2@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-101681-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101681 --- Comment #3 from Steven Sun <StevenSun2021 at hotmail dot com> --- By the way, in the current design, the class definition is passed twice in order we can see every member data/function declaration before parsing NSDMI and member functions. The class is complete after parsing all declaration, which means `&C::f == nullptr` can reduce to false since that. So, under current design, the following code compiles on GCC. https://godbolt.org/z/fMTsf4KoM ``` struct C { C() { static_assert(&C::f != 0); // complete type } void f() noexcept(&C::f != 0) { static_assert(&C::f != 0); // complete type } static_assert(__builtin_constant_p(&C::f)); // incomplete type static_assert(!__builtin_constant_p(&C::f == 0)); // incomplete type }; static_assert(&C::f != 0); // complete type ```
next prev parent reply other threads:[~2021-08-07 0:43 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-29 21:05 [Bug c++/101681] New: " pinskia at gcc dot gnu.org 2021-08-06 19:08 ` [Bug c++/101681] " StevenSun2021 at hotmail dot com 2021-08-07 0:33 ` StevenSun2021 at hotmail dot com 2021-08-07 0:43 ` StevenSun2021 at hotmail dot com [this message] 2022-01-11 18:40 ` [Bug c++/101681] PMF comparison to nullptr is not considered a constexpr inside a template argument pinskia 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-101681-4-A3bmwFOBT2@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).