re PR c++/47132 ([C++0x] decltype can't deduce some operator return types when defining an auto function's return)

PR c++/47132
	* mangle.c (write_expression): Handle MODOP_EXPR.

From-SVN: r174357
This commit is contained in:
Jason Merrill 2011-05-27 15:32:30 -04:00 committed by Jason Merrill
parent 69cf9a1cfe
commit a47d328ff3
4 changed files with 25 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2011-05-27 Jason Merrill <jason@redhat.com>
PR c++/47132
* mangle.c (write_expression): Handle MODOP_EXPR.
PR c++/47277
* parser.c (cp_parser_unqualified_id): Don't check
constructor_name_p for enums.

View File

@ -2599,6 +2599,15 @@ write_expression (tree expr)
write_unqualified_id (fn);
write_template_args (TREE_OPERAND (expr, 1));
}
else if (TREE_CODE (expr) == MODOP_EXPR)
{
enum tree_code subop = TREE_CODE (TREE_OPERAND (expr, 1));
const char *name = (assignment_operator_name_info[(int) subop]
.mangled_name);
write_string (name);
write_expression (TREE_OPERAND (expr, 0));
write_expression (TREE_OPERAND (expr, 2));
}
else
{
int i, len;

View File

@ -1,5 +1,7 @@
2011-05-27 Jason Merrill <jason@redhat.com>
* g++.dg/abi/mangle47.C: New.
PR c++/49176
* g++.dg/template/const5.C: New.

View File

@ -0,0 +1,11 @@
// PR c++/47132
// { dg-options -std=c++0x }
// { dg-final { scan-assembler "_Z1fIiEDToRfp_Li1EET_" } }
template <typename T>
auto f (T t) -> decltype(t |= 1);
int main()
{
f(1);
}