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++/105351] [concepts] Constraint checking does correctly match static member attributes
Date: Tue, 03 May 2022 19:21:45 +0000	[thread overview]
Message-ID: <bug-105351-4-Dqg0sxf5N9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105351-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105351

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:a16fc9f1c96c7361d0b7a83a06f3649ace6c440d

commit r13-95-ga16fc9f1c96c7361d0b7a83a06f3649ace6c440d
Author: Patrick Palka <ppalka@redhat.com>
Date:   Tue May 3 15:21:26 2022 -0400

    c++: make finish_non_static_data_member SFINAE enabled [PR105351]

    Here since finish_non_static_data_member isn't SFINAE enabled, we
    incorrectly emit an error when considering the first overload rather
    than silently discarding it:

    sfinae33.C: In substitution of âtemplate<class T> A<T::value> f() [with T
= B]â:
    sfinae33.C:11:7:   required from here
    sfinae33.C:5:31: error: invalid use of non-static data member
âB::valueâ
        5 | template<class T> A<T::value> f();
          |                               ^

    This patch makes the function SFINAE enabled in the usual way: give it a
    complain parameter, check it before emitting an error, and pass it through
    appropriately.

            PR c++/105351

    gcc/cp/ChangeLog:

            * cp-tree.h (finish_non_static_data_member): Add defaulted
            complain parameter.
            * pt.cc (tsubst_copy_and_build): Pass complain to
            finish_non_static_data_member.
            * semantics.cc (finish_non_static_data_member): Respect complain
            parameter.
            (finish_qualified_id_expr): Pass complain to
            finish_non_static_data_member.

    gcc/testsuite/ChangeLog:

            * g++.dg/template/sfinae33.C: New test.

  parent reply	other threads:[~2022-05-03 19:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22 20:29 [Bug c++/105351] New: " gawain.bolton at free dot fr
2022-04-22 20:44 ` [Bug c++/105351] " pinskia at gcc dot gnu.org
2022-04-23  7:22 ` gawain.bolton at free dot fr
2022-04-23 13:18 ` ensadc at mailnesia dot com
2022-05-01 20:02 ` gawain.bolton at free dot fr
2022-05-03 14:00 ` ppalka at gcc dot gnu.org
2022-05-03 14:24 ` ppalka at gcc dot gnu.org
2022-05-03 19:21 ` cvs-commit at gcc dot gnu.org [this message]
2023-04-18 13:38 ` 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-105351-4-Dqg0sxf5N9@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: link
Be 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).