public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/10437] "using namespace" at global scope creates incorrect code
       [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
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-12-18 18:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dhazeghi at yahoo dot com  2003-12-18 18:07 -------
Nathan, would you mind commenting on the validity of this code? Thanks.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nathan at gcc dot gnu dot
                   |                            |org


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


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

* [Bug c++/10437] "using namespace" at global scope creates incorrect code
       [not found] <20030419003600.10437.dean@foster.net>
  2003-12-18 18:27 ` [Bug c++/10437] "using namespace" at global scope creates incorrect code 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
  2004-08-16 19:02 ` bangerth at dealii dot org
  3 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-12-22 15:57 UTC (permalink / raw)
  To: gcc-bugs



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


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


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

* [Bug c++/10437] "using namespace" at global scope creates incorrect code
       [not found] <20030419003600.10437.dean@foster.net>
  2003-12-18 18:27 ` [Bug c++/10437] "using namespace" at global scope creates incorrect code 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
  2004-08-16 19:02 ` bangerth at dealii dot org
  3 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-12-22 16:51 UTC (permalink / raw)
  To: gcc-bugs


------- 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


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

* [Bug c++/10437] "using namespace" at global scope creates incorrect code
       [not found] <20030419003600.10437.dean@foster.net>
                   ` (2 preceding siblings ...)
  2003-12-22 16:51 ` nathan at gcc dot gnu dot org
@ 2004-08-16 19:02 ` bangerth at dealii dot org
  3 siblings, 0 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2004-08-16 19:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-08-16 19:02 -------
Still happens. To my great surprise, icc also barfs at the 
example listed as "point 2", with the same error message as gcc. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-16 19:02:29
               date|                            |


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


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

* [Bug c++/10437] "using namespace" at global scope creates incorrect code
       [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
  2 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-05-13 10:59 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |4.8.0, 4.9.0
         Resolution|---                         |FIXED

--- Comment #13 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Let's close this, then.


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

* [Bug c++/10437] "using namespace" at global scope creates incorrect code
       [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
  2 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2014-05-13  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Richard Smith from comment #11)
> I disagree. The failure is not in the immediate context of the substitution,
> so this is a hard error. GCC seems to be doing the right thing in all cases
> here.

Agreed. I think GCC has been fixed in both respects since this was active and
this can be closed (maybe after adding the examples to the test suite, but I
think we have equivalents already).


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

* [Bug c++/10437] "using namespace" at global scope creates incorrect code
       [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
  2 siblings, 0 replies; 7+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2014-05-12 23:52 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Smith <richard-gccbugzilla at metafoo dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |richard-gccbugzilla@metafoo
                   |                            |.co.uk

--- Comment #11 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> ---
(In reply to Nathan Sidwell from comment #9)
> Now the second point. This a case of SFINAE failure, no diagnostic should
> be issued.

I disagree. The failure is not in the immediate context of the substitution, so
this is a hard error. GCC seems to be doing the right thing in all cases here.


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

end of thread, other threads:[~2014-05-13 10:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20030419003600.10437.dean@foster.net>
2003-12-18 18:27 ` [Bug c++/10437] "using namespace" at global scope creates incorrect code 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
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

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).