public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35000]  New: #include sometimes fails in namespaces
@ 2008-01-28 19:07 mw268 at bath dot ac dot uk
  2008-01-28 19:09 ` [Bug libstdc++/35000] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mw268 at bath dot ac dot uk @ 2008-01-28 19:07 UTC (permalink / raw)
  To: gcc-bugs

When including a system header in a namespace followed by another system header
seems to prevent declarations being recognized in the headers or some such.
Even happens when the headers are both the same.

Example code:

#ifndef APP_H
#define APP_H

namespace win
{
        #include <string>
}

#include <iostream>

#endif


-- 
           Summary: #include sometimes fails in namespaces
           Product: gcc
           Version: 3.4.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mw268 at bath dot ac dot uk


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/35000] #include sometimes fails in namespaces
  2008-01-28 19:07 [Bug c++/35000] New: #include sometimes fails in namespaces mw268 at bath dot ac dot uk
@ 2008-01-28 19:09 ` pinskia at gcc dot gnu dot org
  2008-01-31  8:22 ` mw268 at bath dot ac dot uk
  2008-01-31 15:12 ` bangerth at dealii dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-28 19:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-01-28 19:02 -------
This is working as designed.  Why are you doing #include inside a namespace
anyways?


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
          Component|c++                         |libstdc++
         Resolution|                            |INVALID


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/35000] #include sometimes fails in namespaces
  2008-01-28 19:07 [Bug c++/35000] New: #include sometimes fails in namespaces mw268 at bath dot ac dot uk
  2008-01-28 19:09 ` [Bug libstdc++/35000] " pinskia at gcc dot gnu dot org
@ 2008-01-31  8:22 ` mw268 at bath dot ac dot uk
  2008-01-31 15:12 ` bangerth at dealii dot org
  2 siblings, 0 replies; 4+ messages in thread
From: mw268 at bath dot ac dot uk @ 2008-01-31  8:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mw268 at bath dot ac dot uk  2008-01-31 06:38 -------
(In reply to comment #1)
> This is working as designed.  Why are you doing #include inside a namespace
> anyways?
> 

I was using it to enclose windows.h in a namespace win to avoid potential
problems and ended up causing one. The reason I thought I was a bug was because
it works if the #include is before the namespace.


-- 


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/35000] #include sometimes fails in namespaces
  2008-01-28 19:07 [Bug c++/35000] New: #include sometimes fails in namespaces mw268 at bath dot ac dot uk
  2008-01-28 19:09 ` [Bug libstdc++/35000] " pinskia at gcc dot gnu dot org
  2008-01-31  8:22 ` mw268 at bath dot ac dot uk
@ 2008-01-31 15:12 ` bangerth at dealii dot org
  2 siblings, 0 replies; 4+ messages in thread
From: bangerth at dealii dot org @ 2008-01-31 15:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from bangerth at dealii dot org  2008-01-31 14:53 -------
This way you make the compiler believe that all the functions
are in a namespace when the compiler that compiled these functions
into a .dll assumed that they are not. This can't work.


-- 


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-31 14:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-28 19:07 [Bug c++/35000] New: #include sometimes fails in namespaces mw268 at bath dot ac dot uk
2008-01-28 19:09 ` [Bug libstdc++/35000] " pinskia at gcc dot gnu dot org
2008-01-31  8:22 ` mw268 at bath dot ac dot uk
2008-01-31 15:12 ` bangerth at dealii dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).