This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/44486] [4.3/4.4/4.5/4.6 regression] missing space in __PRETTY_FUNCTION__ expansion in anonymous namespace



------- Comment #3 from manu at gcc dot gnu dot org  2010-06-11 01:13 -------
Testing this patch:

Index: gcc/testsuite/g++.dg/pr44486.C
===================================================================
--- gcc/testsuite/g++.dg/pr44486.C      (revision 0)
+++ gcc/testsuite/g++.dg/pr44486.C      (revision 0)
@@ -0,0 +1,10 @@
+// PR c++/44486 missing space in __PRETTY_FUNCTION__ expansion in anonymous
namespace
+// { dg-do compile }
+// { dg-options "" }
+
+struct S { };
+namespace { S f() { const char * s = __PRETTY_FUNCTION__; return S(); } }
+
+int main() { f(); }
+
+// { dg-final { scan-assembler "S \{anonymous\}::f" } }
Index: gcc/cp/error.c
===================================================================
--- gcc/cp/error.c      (revision 160464)
+++ gcc/cp/error.c      (working copy)
@@ -944,11 +944,11 @@ dump_decl (tree t, int flags)
        {
          if (! (flags & TFF_UNQUALIFIED_NAME))
            dump_scope (CP_DECL_CONTEXT (t), flags);
          flags &= ~TFF_UNQUALIFIED_NAME;
          if (DECL_NAME (t) == NULL_TREE)
-           pp_string (cxx_pp, M_("<unnamed>"));
+           pp_cxx_ws_string (cxx_pp, M_("{anonymous}"));
          else
            pp_cxx_tree_identifier (cxx_pp, DECL_NAME (t));
        }
       break;


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org
         AssignedTo|unassigned at gcc dot gnu   |manu at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-06-09 22:02:51         |2010-06-11 01:13:59
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44486


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]