public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* C++ PATCH to template printing
@ 2009-09-10  5:15 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2009-09-10  5:15 UTC (permalink / raw)
  To: gcc-patches List

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

I recently noticed that decltypes sometimes show up in function template 
signatures, but the template instance pretty-printing code doesn't tell 
us what they resolve to.  Fixed thus.

Tested x86_64-pc-linux-gnu, applied to trunk.

[-- Attachment #2: print-decltypes.patch --]
[-- Type: text/x-patch, Size: 1133 bytes --]

commit 69620b36e35cb0e5ad2fc6e62c3dbc51a537716e
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Sep 9 12:35:05 2009 -0400

    	* error.c (find_typenames_r): Also add decltypes.

diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 1964929..5d38e02 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1159,7 +1159,8 @@ dump_template_decl (tree t, int flags)
 }
 
 /* find_typenames looks through the type of the function template T
-   and returns a VEC containing any typedefs or TYPENAME_TYPEs it finds.  */
+   and returns a VEC containing any typedefs, decltypes or TYPENAME_TYPEs
+   it finds.  */
 
 struct find_typenames_t
 {
@@ -1176,7 +1177,8 @@ find_typenames_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, void *data)
   if (TYPE_P (*tp) && is_typedef_decl (TYPE_NAME (*tp)))
     /* Add the type of the typedef without any additional cv-quals.  */
     mv = TREE_TYPE (TYPE_NAME (*tp));
-  else if (TREE_CODE (*tp) == TYPENAME_TYPE)
+  else if (TREE_CODE (*tp) == TYPENAME_TYPE
+	   || TREE_CODE (*tp) == DECLTYPE_TYPE)
     /* Add the typename without any cv-qualifiers.  */
     mv = TYPE_MAIN_VARIANT (*tp);
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-10  5:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-10  5:15 C++ PATCH to template printing Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).