This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35835] Compiler fails to recognize match of local "extern" declarations
- From: "pinskia 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 Apr 2008 21:16:01 -0000
- Subject: [Bug c++/35835] Compiler fails to recognize match of local "extern" declarations
- References: <bug-35835-12742@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from pinskia at gcc dot gnu dot org 2008-04-05 21:16 -------
(In reply to comment #4)
> (works with the C frontend)
> We don't share the decls of g_iValue properly, but doesn't this program
> violate the ODR anyway?
No it does not as there is only one g_iValue variable. The reasoning behind
using extern int g_iValue; is so it does not get into the global scope.
The reason why the C front-end works is because we have a non TU scope which we
add decls to and then look up global decls that way and get that decl instead
of creating a new one.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |wrong-code
Last reconfirmed|0000-00-00 00:00:00 |2008-04-05 21:16:01
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35835