aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2008-12-17 14:08:14 -0500
committerJason Merrill <jason@gcc.gnu.org>2008-12-17 14:08:14 -0500
commita77f94e24084115b80f1eb05836d7538b3500c36 (patch)
tree2fc764010bfc532f00bb2946a496b9d1884f5ed0 /gcc/cp/tree.c
parent3aea2d1ce29ba8a41d54857de2c5bcf1a4dce254 (diff)
downloadgcc-a77f94e24084115b80f1eb05836d7538b3500c36.zip
gcc-a77f94e24084115b80f1eb05836d7538b3500c36.tar.gz
gcc-a77f94e24084115b80f1eb05836d7538b3500c36.tar.bz2
semantics.c (describable_type): New function.
gcc/cp: * semantics.c (describable_type): New function. (finish_decltype_type): Use it for dependent exprs. * cp-tree.h: Declare it. * mangle.c (write_type) [DECLTYPE_TYPE]: Set skip_evaluation. (write_expression): If skip_evaluation, use type stubs. * tree.c (cp_tree_equal): Handle PARM_DECLs from different declarations of a function. * init.c (build_new): Do auto deduction if type is describable. * decl.c (cp_finish_decl): Likewise. * parser.c (cp_parser_omp_for_loop): Likewise. gcc/testsuite: * g++.dg/cpp0x/auto6.C: Test more stuff. * g++.dg/cpp0x/auto12.C: New test. libiberty: * cp-demangle.c (d_expression): Handle rvalue stubs too. [DEMANGLE_COMPONENT_CAST]: Update mangling. (d_print_comp): Avoid extra ", " with empty template argument packs. Remove handling for obsolete T() mangling. From-SVN: r142799
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 2ae6543..1f2c631 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1857,8 +1857,17 @@ cp_tree_equal (tree t1, tree t2)
return false;
return cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
- case VAR_DECL:
case PARM_DECL:
+ /* For comparing uses of parameters in late-specified return types
+ with an out-of-class definition of the function. */
+ if ((!DECL_CONTEXT (t1) || !DECL_CONTEXT (t2))
+ && same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))
+ && DECL_NAME (t1) == DECL_NAME (t2))
+ return true;
+ else
+ return false;
+
+ case VAR_DECL:
case CONST_DECL:
case FUNCTION_DECL:
case TEMPLATE_DECL: