public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nathan at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/10437] "using namespace" at global scope creates incorrect code
Date: Mon, 22 Dec 2003 16:51:00 -0000	[thread overview]
Message-ID: <20031222163631.25943.qmail@sources.redhat.com> (raw)
In-Reply-To: <20030419003600.10437.dean@foster.net>


------- Additional Comments From nathan at gcc dot gnu dot org  2003-12-22 16:36 -------
Ok, First point1. Do using declarations work retroactively in this regard.
For a dependent name, the answer is yes, sort of. [14.6.4] lists the places you
look to resolve a dependent name, and they are
1) declarations that are visible at the point of definition of the template
2) declarations from namespaces associated with the type of the function arguments
both from the instantiation context and from the definition context.

That 2nd part is an amalgamated koenig lookup. In this case the type is int, so
has no associated namespaces, and hence adds nothing to the overload set.

Thus, I believe instantiation of bar will give an unresolved call for foo.

Now the second point. This a case of SFINAE failure, no diagnostic should
be issued. The call of foo in bar must resolve to ::foo(int), as the other
posibility ::foo<int>(const int &) gives a substitution failure.

The EDG compiler accepts this code.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|nathan at gcc dot gnu dot   |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW


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


  parent reply	other threads:[~2003-12-22 16:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030419003600.10437.dean@foster.net>
2003-12-18 18:27 ` dhazeghi at yahoo dot com
2003-12-22 15:57 ` nathan at gcc dot gnu dot org
2003-12-22 16:51 ` nathan at gcc dot gnu dot org [this message]
2004-08-16 19:02 ` bangerth at dealii dot org
     [not found] <bug-10437-4@http.gcc.gnu.org/bugzilla/>
2014-05-12 23:52 ` richard-gccbugzilla at metafoo dot co.uk
2014-05-13  8:28 ` redi at gcc dot gnu.org
2014-05-13 10:59 ` paolo.carlini at oracle dot com

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=20031222163631.25943.qmail@sources.redhat.com \
    --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).