public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "o dot kullmann at swansea dot ac dot uk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/26470]  New: correct code doesn't compile (global namespace qualification)
Date: Sat, 25 Feb 2006 19:33:00 -0000	[thread overview]
Message-ID: <bug-26470-781@http.gcc.gnu.org/bugzilla/> (raw)

#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


             reply	other threads:[~2006-02-25 19:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-25 19:33 o dot kullmann at swansea dot ac dot uk [this message]
2006-02-25 19:33 ` [Bug c++/26470] " pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-26470-781@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).