public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105520] Ignores constraint in auto declaration with braced-init-list Date: Sat, 06 Apr 2024 21:30:49 +0000 [thread overview] Message-ID: <bug-105520-4-KS9eDMowr8@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105520-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105520 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Blocks| |67491 Ever confirmed|0 |1 Last reconfirmed| |2024-04-06 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. This works as expected, in that we are getting the correct type for auto here: ``` #include <concepts> #include <initializer_list> template <typename T> concept always_true = true; template <typename T> concept always_false = false; template <typename> inline constexpr bool is_init_list_v = false; template <typename T> inline constexpr bool is_init_list_v<std::initializer_list<T>> = true; template <typename T> concept not_init_list = !is_init_list_v<std::remove_cvref_t<T>>; template <typename T> inline constexpr bool not_init_list1 = !is_init_list_v<std::remove_cvref_t<T>>; int main() { auto f = {1, 2, 3}; static_assert(!not_init_list<decltype(f)>); static_assert(!not_init_list1<decltype(f)>); } ``` Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491 [Bug 67491] [meta-bug] concepts issues
prev parent reply other threads:[~2024-04-06 21:30 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-08 1:55 [Bug c++/105520] New: " cooky.ykooc922 at gmail dot com 2022-05-08 1:58 ` [Bug c++/105520] " cooky.ykooc922 at gmail dot com 2024-04-06 21:30 ` pinskia 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-105520-4-KS9eDMowr8@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).