Commit 32210fd6 by Paolo Carlini Committed by Paolo Carlini

re PR c++/51397 (static_assert message formatting)

/cp
2011-12-31  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51397
	* semantics.c (finish_static_assert): Use %s instead of %E for
	the error message.

/testsuite
2011-12-31  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51397
	* g++.dg/cpp0x/static_assert6.C: New.

From-SVN: r182757
parent 553fb1c2
2011-12-31 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51397
* semantics.c (finish_static_assert): Use %s instead of %E for
the error message.
2011-12-27 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/23211
......
......@@ -5127,7 +5127,7 @@ finish_static_assert (tree condition, tree message, location_t location,
if (TREE_CODE (condition) == INTEGER_CST
&& integer_zerop (condition))
/* Report the error. */
error ("static assertion failed: %E", message);
error ("static assertion failed: %s", TREE_STRING_POINTER (message));
else if (condition && condition != error_mark_node)
{
error ("non-constant condition for static assertion");
......
2011-12-31 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51397
* g++.dg/cpp0x/static_assert6.C: New.
2011-12-31 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/tree-ssa/vrp47: Pass -march=i586 for ia32 target.
......
// PR c++/51397
// { dg-options "-std=c++0x" }
static_assert('X' != '\130', "'X' has the wrong value"); // { dg-error "'X' has the wrong value" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment