public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ppalka 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 14:00:47 +0000 [thread overview]
Message-ID: <bug-105351-4-yD5yrkyFOz@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
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppalka at gcc dot gnu.org
--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Gawain Bolton from comment #4)
> Finally, this also begs the question as to how one could write a requirement
> to ensure a class has a static attribute.
One way is to replace the requirement 'T::attr2' with 'typename
dummy<&T::attr2>' where 'dummy' is the class template
template<auto*> struct dummy;
This works because template arguments are constant expressions, and constant
expressions are evaluated even in unevaluated contexts, so the bullet point
that ensadc pointed out in comment #3 no longer applies.
This makes both Clang and GCC happy: https://godbolt.org/z/c8q355hfh
next prev parent reply other threads:[~2022-05-03 14:00 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 [this message]
2022-05-03 14:24 ` ppalka at gcc dot gnu.org
2022-05-03 19:21 ` cvs-commit at gcc dot gnu.org
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-yD5yrkyFOz@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).