[Bug c++/30112] pragma redefine_extname fails when namespaces are involved

2011-07-22 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30112

--- Comment #7 from Jason Merrill jason at gcc dot gnu.org 2011-07-22 
19:59:51 UTC ---
Author: jason
Date: Fri Jul 22 19:59:49 2011
New Revision: 176650

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=176650
Log:
PR c++/30112
gcc/c-family/
* c-common.h: Declare c_linkage_bindings.
* c-pragma.c (handle_pragma_redefine_extname): Use it.
gcc/
* c-decl.c (c_linkage_bindings): Define.
gcc/cp/
* decl.c (cp_finish_decl): Apply pragma redefine_extname in
other namespaces as well.
* name-lookup.c (c_linkage_bindings): Define.
(lookup_extern_c_fun_in_all_ns): Rename from
lookup_extern_c_fun_binding_in_all_ns.  Return tree.
(pushdecl_maybe_friend_1): Adjust.  Copy DECL_ASSEMBLER_NAME.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-decl.c
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-common.h
trunk/gcc/c-family/c-pragma.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/cp/name-lookup.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/other/pragma-re-1.C


[Bug c++/30112] pragma redefine_extname fails when namespaces are involved

2011-07-22 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30112

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.7.0

--- Comment #8 from Jason Merrill jason at gcc dot gnu.org 2011-07-22 
20:07:04 UTC ---
Fixed for 4.7.


[Bug c++/30112] pragma redefine_extname fails when namespaces are involved

2011-07-21 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30112

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 CC||jason at redhat dot com

--- Comment #4 from Paolo Carlini paolo.carlini at oracle dot com 2011-07-21 
12:11:37 UTC ---
Jason, I gather this is blocking libstdc++/1773, which we would really like to
finally fix, can you have a look? Thanks in advance.


[Bug c++/30112] pragma redefine_extname fails when namespaces are involved

2011-07-21 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30112

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2011.07.21 15:06:46
 CC||jason at gcc dot gnu.org
 AssignedTo|unassigned at gcc dot   |jason at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1


[Bug c++/30112] pragma redefine_extname fails when namespaces are involved

2011-07-21 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30112

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

 CC|jason at redhat dot com |

--- Comment #5 from Jason Merrill jason at gcc dot gnu.org 2011-07-21 
15:41:52 UTC ---
Incidentally, when adding me to the CC list of a PR, please use
ja...@gcc.gnu.org rather than ja...@redhat.com.


[Bug c++/30112] pragma redefine_extname fails when namespaces are involved

2011-07-21 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30112

--- Comment #6 from Paolo Carlini paolo.carlini at oracle dot com 2011-07-21 
15:49:16 UTC ---
Agreed (indeed, I saw both in Bugzilla but never figured out which one you
preferred ;)


[Bug c++/30112] pragma redefine_extname fails when namespaces are involved

2007-02-22 Thread marc dot glisse at normalesup dot org


--- Comment #3 from marc dot glisse at normalesup dot org  2007-02-22 16:20 
---
Actually, the patch is not sufficient. With the patch, it works if the function
is in the global namespace or the pragma is before the declaration (or both),
but not for a function in the std namespace where the pragma is after the
declaration, as is the case for wcsftime in solaris iso/wchar_iso.h.

The little I understand: it seems that in c-pragma.c, for some reason,
identifier_global_value(oldname) returns 0 in this case, so the renaming is not
done.


-- 


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



[Bug c++/30112] pragma redefine_extname fails when namespaces are involved

2007-01-08 Thread marc dot glisse at normalesup dot org


--- Comment #2 from marc dot glisse at normalesup dot org  2007-01-08 14:27 
---
Created an attachment (id=12870)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12870action=view)
patch to call the renaming function in any namespace


-- 


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



[Bug c++/30112] pragma redefine_extname fails when namespaces are involved

2006-12-12 Thread marc dot glisse at normalesup dot org


--- Comment #1 from marc dot glisse at normalesup dot org  2006-12-12 18:40 
---
In gcc/cp/decl.c, I see:

  if (global_scope_p (current_binding_level))
asmspec_tree = maybe_apply_renaming_pragma (decl, asmspec_tree);

So if I understand correctly (it is the first time I have a look at the gcc
internals), there is an explicit test that means the renaming function is only
called for the global namespace. Simply removing the test (and so always
executing the next line) seems to solve my problem, but I don't know if it
breaks other things or slows everything down.


-- 


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