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++/35835] Compiler fails to recognize match of local "extern" declarations



------- 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


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