public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/13377] [3.4 regression] unexpected behavior of namespace usage directive
Date: Wed, 31 Aug 2005 11:21:00 -0000	[thread overview]
Message-ID: <20050831110741.32736.qmail@sourceware.org> (raw)
In-Reply-To: <20031210171832.13377.boris@kolpackov.net>


------- Additional Comments From reichelt at gcc dot gnu dot org  2005-08-31 11:07 -------
For the testcase

  ==================================
  namespace N
  {
    int i;
  }

  int i;

  using namespace N;

  void foo() { i; }
  ==================================

we now get

  ambig4.C: In function 'void foo()':
  ambig4.C:10: error: use of 'i' is ambiguous
  ambig4.C:6: error:   first declared as 'int i' here
  ambig4.C:3: error:   also declared as 'int N::i' here
  ambig4.C:10: error: 'i' was not declared in this scope

Btw, this is the testcase which was a regression from GCC 3.3.x.

For the testcase

  ==================================
  namespace N
  {
    namespace M {}
  }

  namespace M {}

  using namespace N;
  using namespace M;
  ==================================

we now get (since the patch for PR23586 is also in place):

  ambig5.C:13: error: use of 'M' is ambiguous
  ambig5.C:10: error:   first declared as 'namespace M { }' here
  ambig5.C:7: error:   also declared as 'namespace M { }' here
  ambig5.C:13: error: 'M' is not a namespace-name
  ambig5.C:13: error: expected namespace-name before ';' token

This is still a little suboptimal (first we say it's ambiguous,
then we say it's not declared/not a namespace-name), but I think
the user can figure out the problem now.

So this is fixed on mainline and the 4.0 branch.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2005-
                   |                            |08/msg01717.html
            Summary|unexpected behavior of      |[3.4 regression] unexpected
                   |namespace usage directive   |behavior of namespace usage
                   |                            |directive
   Target Milestone|---                         |3.4.5


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


  parent reply	other threads:[~2005-08-31 11:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-10 17:18 [Bug c++/13377] New: " boris at kolpackov dot net
2003-12-10 17:44 ` [Bug c++/13377] " pinskia at gcc dot gnu dot org
2005-08-29 13:37 ` reichelt at gcc dot gnu dot org
2005-08-31 10:33 ` reichelt at gcc dot gnu dot org
2005-08-31 10:54 ` cvs-commit at gcc dot gnu dot org
2005-08-31 11:04 ` cvs-commit at gcc dot gnu dot org
2005-08-31 11:21 ` reichelt at gcc dot gnu dot org [this message]
2005-09-01 11:32 ` [Bug c++/13377] [3.4 regression] " cvs-commit at gcc dot gnu dot org
2005-09-01 11:33 ` reichelt 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=20050831110741.32736.qmail@sourceware.org \
    --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).