public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26470] correct code doesn't compile (global namespace qualification)
  2006-02-25 19:33 [Bug c++/26470] New: correct code doesn't compile (global namespace qualification) o dot kullmann at swansea dot ac dot uk
@ 2006-02-25 19:33 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-25 19:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-02-25 19:33 -------


*** This bug has been marked as a duplicate of 26468 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug c++/26470]  New: correct code doesn't compile (global namespace qualification)
@ 2006-02-25 19:33 o dot kullmann at swansea dot ac dot uk
  2006-02-25 19:33 ` [Bug c++/26470] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: o dot kullmann at swansea dot ac dot uk @ 2006-02-25 19:33 UTC (permalink / raw)
  To: gcc-bugs

#include <string>
namespace N {
  struct X { static std::string s(); };
}
namespace N {
  inline std::string ::N::X::s() { return ""; }
}
int main() {}

compiled with version 3.4.3 or 4.0.2 yields
GCC_Fehler_25022006.cpp:6: error: &#8216;struct std::string::N&#8217; has not
been declared
GCC_Fehler_25022006.cpp:6: error: ISO C++ forbids declaration of
&#8216;s&#8217; with no type
GCC_Fehler_25022006.cpp: In function &#8216;int N::s()&#8217;:
GCC_Fehler_25022006.cpp:6: error: invalid conversion from &#8216;const
char*&#8217; to &#8216;int&#8217;

But I believe the above code is correct. Changing ::N::X::s() to N::X::s()
makes the code compile.


-- 
           Summary: correct code doesn't compile (global namespace
                    qualification)
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: o dot kullmann at swansea dot ac dot uk


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


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

end of thread, other threads:[~2006-02-25 19:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-25 19:33 [Bug c++/26470] New: correct code doesn't compile (global namespace qualification) o dot kullmann at swansea dot ac dot uk
2006-02-25 19:33 ` [Bug c++/26470] " pinskia at gcc dot gnu 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).