public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c++/10437: "using namespace" at global scope creates incorrect code
Date: Mon, 21 Apr 2003 20:06:00 -0000	[thread overview]
Message-ID: <20030421200600.16035.qmail@sources.redhat.com> (raw)

The following reply was made to PR c++/10437; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: Dean Foster <foster@diskworld.wharton.upenn.edu>
Cc: dean@foster.net, <gcc-bugs@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org>
Subject: Re: c++/10437: "using namespace" at global scope creates incorrect
 code
Date: Mon, 21 Apr 2003 15:03:33 -0500 (CDT)

 > I'm willing to agree that that I've have an error/ambiguity in my
 > code.  But I don't understand why bringing in a namespace that isn't
 > being called should change the ambiguity status.
 
 The point is that in order to find out which function the compiler 
 shall take, it needs to know about the possibilities. For this, the
 possible declarations must "work". Without knowing your choices, you can't 
 perform overload resolution.
 
 
 > In other words,
 > 
 > 		main()
 > 		{
 > 		  using namespace foo;
 > 		  /* ... */           // no error
 > 		}
 > doesn't generate an error. But, the following does generate an error:
 > 		  
 > 		using namespace foo;
 > 		main()
 > 		{
 > 		  /* ... */         // generates error
 > 		}
 > 
 > It seems that [they] should be the same. 
 
 I guess that should be so.
 
 I can't reproduce this with the small example I posted. Can you try to 
 come up with something short that shows this? Your original example was 
 incredibly contrived, and I don't want to go through the ordeal again of 
 reducing it, which took me well over an hour. Hint: try stripping template 
 parameters, and replacing typedefs by the types the point to, etc. Once 
 it's well below 100 lines I'll be willing to look at it again :-)
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                                www: http://www.ices.utexas.edu/~bangerth/
 
 


             reply	other threads:[~2003-04-21 20:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-21 20:06 Wolfgang Bangerth [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-04-25 19:46 Wolfgang Bangerth
2003-04-25 19:38 bangerth
2003-04-21 19:26 Dean Foster
2003-04-21 15:06 bangerth
2003-04-19  0:36 dean

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=20030421200600.16035.qmail@sources.redhat.com \
    --to=bangerth@ices.utexas.edu \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@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).