This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH: a couple of tiny cleanups
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 02 Sep 2009 11:48:18 -0400
- Subject: C++ PATCH: a couple of tiny cleanups
describable_type isn't used for mangling anymore, so we don't need to
pretend to be in a template.
debug_tree wasn't being very helpful about DECLTYPE_TYPE.
Tested x86_64-pc-linux-gnu, applied to trunk.
commit b8126335808b87f34a08677e80a0527a0f3a65a4
Author: Jason Merrill <jason@redhat.com>
Date: Wed Sep 2 00:24:12 2009 -0400
* semantics.c (describable_type): Don't pretend to be in a template.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 1c16b72..1e5255e 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -4543,17 +4543,13 @@ describable_type (tree expr)
{
tree type = NULL_TREE;
- /* processing_template_decl isn't set when we're called from the mangling
- code, so bump it now. */
- ++processing_template_decl;
if (! type_dependent_expression_p (expr)
&& ! type_unknown_p (expr))
{
- type = TREE_TYPE (expr);
+ type = unlowered_expr_type (expr);
if (real_lvalue_p (expr))
type = build_reference_type (type);
}
- --processing_template_decl;
if (type)
return type;
commit ee5eb02b0d9de6a990a6212136e52f200fecd91a
Author: Jason Merrill <jason@redhat.com>
Date: Tue Sep 1 10:54:12 2009 -0400
* ptree.c (cxx_print_type) [DECLTYPE_TYPE]: Print the expression.
diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c
index 69279cd..a1fa71f 100644
--- a/gcc/cp/ptree.c
+++ b/gcc/cp/ptree.c
@@ -95,6 +95,10 @@ cxx_print_type (FILE *file, tree node, int indent)
case UNION_TYPE:
break;
+ case DECLTYPE_TYPE:
+ print_node (file, "expr", DECLTYPE_TYPE_EXPR (node), indent + 4);
+ return;
+
default:
return;
}