This is the mail archive of the
mailing list for the GCC project.
Re: [C++17] Implement N3928 - Extending static_assert
- From: Jason Merrill <jason at redhat dot com>
- To: Ed Smith-Rowland <3dw4rd at verizon dot net>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Paolo Carlini <paolo dot carlini at oracle dot com>
- Date: Wed, 20 May 2015 11:28:24 -0400
- Subject: Re: [C++17] Implement N3928 - Extending static_assert
- Authentication-results: sourceware.org; auth=none
- References: <55453092 dot 5050501 at verizon dot 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
I think many people just write
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.