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:
parent
69cf9a1cfe
commit
a47d328ff3
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
||||
|
11
gcc/testsuite/g++.dg/abi/mangle47.C
Normal file
11
gcc/testsuite/g++.dg/abi/mangle47.C
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user