This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51397] New: static_assert message formatting
- From: "dave at boost-consulting dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 03 Dec 2011 22:07:08 +0000
- Subject: [Bug c++/51397] New: static_assert message formatting
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51397
Bug #: 51397
Summary: static_assert message formatting
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: dave@boost-consulting.com
I just noticed that GCC can be overly-helpful ;-) when formatting a
static assertion message:
static_assert('X' != '\130',"'X' has the wrong value");
gives me
error: static assertion failed: "\'X\' has the wrong value"
I suggest that GCC should drop the surrounding quotes and not try to
escape any characters in the message. Otherwise, things like
#define static_assert_(x) static_assert(x, #x)
static_assert_('X' != '\130')
turn out quite badly.
The point of this facility is, after all, to help programmers report legible
errors!