public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26536]  New: wrong name lookup in a class template in presence of namespaces
@ 2006-03-03  0:45 gawrilow at math dot tu-berlin dot de
  2006-03-03  0:47 ` [Bug c++/26536] " gawrilow at math dot tu-berlin dot de
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gawrilow at math dot tu-berlin dot de @ 2006-03-03  0:45 UTC (permalink / raw)
  To: gcc-bugs

This bug seems to be marked as "closed" under the Id 2922.

However, the attached testcase can be successfully compiled by gcc 3.3.5 and
3.4,5, while the brand new gcc 4.1.0 rejects it.  If one puts everything in the
global namespace, it compiles again.

I fear, this issue is still far from being closed.


-- 
           Summary: wrong name lookup in a class template in presence of
                    namespaces
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gawrilow at math dot tu-berlin dot de
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug c++/26536] wrong name lookup in a class template in presence of namespaces
  2006-03-03  0:45 [Bug c++/26536] New: wrong name lookup in a class template in presence of namespaces gawrilow at math dot tu-berlin dot de
@ 2006-03-03  0:47 ` gawrilow at math dot tu-berlin dot de
  2006-03-03  0:51 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: gawrilow at math dot tu-berlin dot de @ 2006-03-03  0:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from gawrilow at math dot tu-berlin dot de  2006-03-03 00:47 -------
Created an attachment (id=10957)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10957&action=view)
this testcase should compile without diagnostics


-- 


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


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

* [Bug c++/26536] wrong name lookup in a class template in presence of namespaces
  2006-03-03  0:45 [Bug c++/26536] New: wrong name lookup in a class template in presence of namespaces gawrilow at math dot tu-berlin dot de
  2006-03-03  0:47 ` [Bug c++/26536] " gawrilow at math dot tu-berlin dot de
@ 2006-03-03  0:51 ` pinskia at gcc dot gnu dot org
  2006-03-03  0:52 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-03  0:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-03-03 00:51 -------
No this should not compile and here is why:
class Rational {
public:
   Rational& negate() { return *this; }
};

namespace pm {
   Rational& inv_sign(Rational& x) { return x.negate(); }
}


Rational is in the toplevel namespace so that is the only place where argument
dependent lookup will look to find the function inv_sign.  Argument dependent
lookup will not relook into the namespace pm.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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

* [Bug c++/26536] wrong name lookup in a class template in presence of namespaces
  2006-03-03  0:45 [Bug c++/26536] New: wrong name lookup in a class template in presence of namespaces gawrilow at math dot tu-berlin dot de
  2006-03-03  0:47 ` [Bug c++/26536] " gawrilow at math dot tu-berlin dot de
  2006-03-03  0:51 ` pinskia at gcc dot gnu dot org
@ 2006-03-03  0:52 ` pinskia at gcc dot gnu dot org
  2006-03-04 19:27 ` pinskia at gcc dot gnu dot org
  2006-03-04 19:59 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-03  0:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-03-03 00:52 -------
*** Bug 26535 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug c++/26536] wrong name lookup in a class template in presence of namespaces
  2006-03-03  0:45 [Bug c++/26536] New: wrong name lookup in a class template in presence of namespaces gawrilow at math dot tu-berlin dot de
                   ` (2 preceding siblings ...)
  2006-03-03  0:52 ` pinskia at gcc dot gnu dot org
@ 2006-03-04 19:27 ` pinskia at gcc dot gnu dot org
  2006-03-04 19:59 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-04 19:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-03-04 19:27 -------
*** Bug 26563 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug c++/26536] wrong name lookup in a class template in presence of namespaces
  2006-03-03  0:45 [Bug c++/26536] New: wrong name lookup in a class template in presence of namespaces gawrilow at math dot tu-berlin dot de
                   ` (3 preceding siblings ...)
  2006-03-04 19:27 ` pinskia at gcc dot gnu dot org
@ 2006-03-04 19:59 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-04 19:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-03-04 19:59 -------
Comeau C++ also rejects this code while in strict mode:
"ComeauTest.c", line 7: error: no instance of overloaded function
"pm::inv_sign"
          matches the argument list
            The argument types that you used are: (Rational)
        Op& assign(Op& a) const { return inv_sign(a); }
                                         ^
          detected during instantiation of "Op &pm::neg_scalar<Op>::assign(Op
                    &) const [with Op=Rational]" at line 23

1 error detected in the compilation of "ComeauTest.c".

Test it for yourself at:
http://www.comeaucomputing.com/tryitout/

The default settings for the web page is strict mode.


-- 


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


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

end of thread, other threads:[~2006-03-04 19:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-03  0:45 [Bug c++/26536] New: wrong name lookup in a class template in presence of namespaces gawrilow at math dot tu-berlin dot de
2006-03-03  0:47 ` [Bug c++/26536] " gawrilow at math dot tu-berlin dot de
2006-03-03  0:51 ` pinskia at gcc dot gnu dot org
2006-03-03  0:52 ` pinskia at gcc dot gnu dot org
2006-03-04 19:27 ` pinskia at gcc dot gnu dot org
2006-03-04 19:59 ` pinskia at gcc dot gnu dot org

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