This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16630] missing type name in __PRETTY_FUNCTION__
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jun 2010 23:48:25 -0000
- Subject: [Bug c++/16630] missing type name in __PRETTY_FUNCTION__
- References: <bug-16630-1186@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from manu at gcc dot gnu dot org 2010-06-05 23:48 -------
(In reply to comment #7)
> Indeed, so I'll close this.
> 4.4 gives
> const char* D<U>::foo(typename B<U>::X) [with U = int]
> and 4.6 gives
> const char* D<U>::foo(typename B<U>::X) [with U = int, typename B<U>::X = int]
>
Could you add a testcase before closing so we don't regress? I propose:
Index: gcc/testsuite/g++.dg/ext/pretty3.C
===================================================================
--- gcc/testsuite/g++.dg/ext/pretty3.C (revision 0)
+++ gcc/testsuite/g++.dg/ext/pretty3.C (revision 0)
@@ -0,0 +1,19 @@
+// PR c++/16630
+// { dg-do compile }
+// { dg-options "" }
+extern "C" int printf (const char*, ...);
+
+template <class T>
+struct B { typedef T X; };
+
+template <class U>
+struct D
+{
+ const char* foo (typename B<U>::X) { return __PRETTY_FUNCTION__; }
+};
+
+int main ()
+{
+ printf ("%s\n", D<int>().foo (0));
+}
+// { dg-final { scan-assembler "const char\\* D<U>::foo\\(typename
B<U>::X\\).*with U = int, typename B<U>::X = int" } }
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu dot org
Status|RESOLVED |REOPENED
Resolution|FIXED |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16630