Commit 5ceb809d by Jason Merrill Committed by Jason Merrill

re PR c++/52521 ([C++11] user defined literals and order of declaration)

	PR c++/52521
	* mangle.c (write_literal_operator_name): The length comes after the
	operator prefix.

From-SVN: r185079
parent 12fc7dea
2012-03-07 Jason Merrill <jason@redhat.com>
PR c++/52521
* mangle.c (write_literal_operator_name): The length comes after the
operator prefix.
2012-03-05 Jakub Jelinek <jakub@redhat.com>
* pt.c (local_specializations): Change from htab_t into
......
......@@ -1292,18 +1292,16 @@ write_source_name (tree identifier)
}
/* Write a user-defined literal operator.
::= li <source-name> # "" <source-name>
IDENTIFIER is an LITERAL_IDENTIFIER_NODE. */
static void
write_literal_operator_name (tree identifier)
{
const char* suffix = UDLIT_OP_SUFFIX (identifier);
char* buffer = XNEWVEC (char, strlen (UDLIT_OP_MANGLED_PREFIX)
+ strlen (suffix) + 10);
sprintf (buffer, UDLIT_OP_MANGLED_FORMAT, suffix);
write_unsigned_number (strlen (buffer));
write_identifier (buffer);
write_identifier (UDLIT_OP_MANGLED_PREFIX);
write_unsigned_number (strlen (suffix));
write_identifier (suffix);
}
/* Encode 0 as _, and 1+ as n-1_. */
......
2012-03-07 Jason Merrill <jason@redhat.com>
PR c++/52521
* g++.dg/cpp0x/udlit-mangle.C: New.
2012-03-06 Pat Haugen <pthaugen@us.ibm.com>
* gcc.dg/torture/va-arg-25.c: Fix typo for powerpc64-*-* check.
......
// PR c++/52521
// { dg-options -std=c++0x }
// { dg-final { scan-assembler "_Zli2_wPKc" } }
int operator "" _w(const char*);
int main() {
123_w;
}
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