public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104752] `Concept auto(x)` should not be a valid function-style cast Date: Thu, 10 Mar 2022 16:23:00 +0000 [thread overview] Message-ID: <bug-104752-4-4RtWNkgRFs@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-104752-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104752 --- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>: https://gcc.gnu.org/g:97f76b5fc4b637033229e53033b4f8b6dc23472c commit r12-7600-g97f76b5fc4b637033229e53033b4f8b6dc23472c Author: Marek Polacek <polacek@redhat.com> Date: Wed Mar 2 12:12:33 2022 -0500 c++: Don't allow type-constraint auto(x) [PR104752] 104752 points out that template<class T> concept C = true; auto y = C auto(1); is ill-formed as per [dcl.type.auto.deduct]: "For an explicit type conversion, T is the specified type, which shall be auto." which doesn't allow type-constraint auto. PR c++/104752 gcc/cp/ChangeLog: * semantics.cc (finish_compound_literal): Disallow auto{x} for is_constrained_auto. * typeck2.cc (build_functional_cast_1): Likewise. gcc/testsuite/ChangeLog: * g++.dg/cpp23/auto-fncast12.C: New test.
next prev parent reply other threads:[~2022-03-10 16:23 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-03-02 9:09 [Bug c++/104752] New: " ensadc at mailnesia dot com 2022-03-02 15:52 ` [Bug c++/104752] " mpolacek at gcc dot gnu.org 2022-03-10 16:23 ` cvs-commit at gcc dot gnu.org [this message] 2022-03-10 16:28 ` mpolacek 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-104752-4-4RtWNkgRFs@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).