From: Jason Merrill <jason@redhat.com>
To: Ed Smith-Rowland <3dw4rd@verizon.net>,
gcc-patches <gcc-patches@gcc.gnu.org>,
Paolo Carlini <paolo.carlini@oracle.com>
Subject: Re: [C++17] Implement N3928 - Extending static_assert
Date: Wed, 20 May 2015 15:29:00 -0000 [thread overview]
Message-ID: <555CA818.7020301@redhat.com> (raw)
In-Reply-To: <55453092.5050501@verizon.net>
On 05/02/2015 04:16 PM, Ed Smith-Rowland wrote:
> This extends' static assert to not require a message string.
> I elected to make this work also for C++11 and C++14 and warn only with
> -pedantic.
> I think many people just write
> static_assert(thing, "");
> .
>
> I took the path of building an empty string in the parser in this case.
> I wasn't sure if setting message to NULL_TREE would cause sadness later
> on or not.
Hmm. Yes, this technically implements the feature, but my impression of
the (non-normative) intent was that they wanted leaving out the string
to print the argument expression, in about the same way as
#define BOOST_STATIC_ASSERT( B ) static_assert(B, #B)
So the patch is OK as is, but you might also look into some libcpp magic
to insert a second argument that stringizes the first.
Jason
next prev parent reply other threads:[~2015-05-20 15:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-02 20:16 Ed Smith-Rowland
2015-05-04 15:28 ` Marek Polacek
2015-05-20 1:56 ` [PING] " Ed Smith-Rowland
2015-05-20 15:29 ` Jason Merrill [this message]
2015-06-15 16:07 ` Jason Merrill
2015-06-16 0:37 ` Ed Smith-Rowland
2015-06-17 14:44 ` Jason Merrill
2015-06-17 18:17 ` Ed Smith-Rowland
2015-06-17 19:39 ` Jason Merrill
2015-06-24 15:39 ` Ed Smith-Rowland
2015-08-04 16:10 ` Paolo Carlini
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=555CA818.7020301@redhat.com \
--to=jason@redhat.com \
--cc=3dw4rd@verizon.net \
--cc=gcc-patches@gcc.gnu.org \
--cc=paolo.carlini@oracle.com \
/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).