public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104567] SFINAE check failure with trying to access member field on the default template argument for a function Date: Thu, 17 Feb 2022 10:38:51 +0000 [thread overview] Message-ID: <bug-104567-4-KPaHIuXjKE@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-104567-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104567 Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Known to fail| |12.0 --- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- A testcase that shows the bug is a lot more useful than one that needs something uncommented to show the bug. template <typename _TAny, char const* value = _TAny::param> constexpr bool has_char_static_param(int) { return true; } template <typename _TAny> constexpr bool has_char_static_param(...) { return false; } struct works1 { constexpr static char param[] = "param"; }; struct works2 { constexpr static int param = 0; }; struct fails { char const* param; // not static }; static_assert(has_char_static_param<works1>(0), ""); static_assert(!has_char_static_param<works2>(0), ""); static_assert(!has_char_static_param<fails>(0), ""); // FAILS
prev parent reply other threads:[~2022-02-17 10:38 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-02-16 14:45 [Bug c++/104567] New: SFINAE check failure starting gcc 4.7.1 and up with -std=c++11 armenchik at mail dot ru 2022-02-16 22:53 ` [Bug c++/104567] " pinskia at gcc dot gnu.org 2022-02-16 22:58 ` [Bug c++/104567] SFINAE check failure with trying to access member field pinskia at gcc dot gnu.org 2022-02-16 23:03 ` pinskia at gcc dot gnu.org 2022-02-17 10:38 ` redi at gcc dot gnu.org [this message]
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-104567-4-KPaHIuXjKE@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).