public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13399] New: G++ 3.3 fails to match the templatized, overloaded operator for subtypes defined in the class template
@ 2003-12-14 15:05 wirawan0 at softhome dot net
  2003-12-14 15:07 ` [Bug c++/13399] " wirawan0 at softhome dot net
  2003-12-15  9:48 ` bangerth at dealii dot org
  0 siblings, 2 replies; 3+ messages in thread
From: wirawan0 at softhome dot net @ 2003-12-14 15:05 UTC (permalink / raw)
  To: gcc-bugs

G++ version 3.3 _DOES_ accept templatized operator definition for a class
template's subtype, yet when it _FAILS_ to find this pattern when it comes to an
actual call to that operator. Is this against C++ standard? I don't think so (or
at least it should not have been so). I put more detail on the attachment. But
the kind of template declaration that fails is like this:

template <class param_type>
inline bool operator||(typename Class<param_type>::Subtype &c1,
                       typename Class<param_type>::Subtype &c2)
{
    return c1.x || c2.x;
}


VERSION KNOWN TO BE AFFECTED: 3.2.2, 3.3.1

    $ /usr/local/bin/g++ -v
    Reading specs from
/usr/local/gcc-3.3.1/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/specs
    Configured with: ./configure --prefix=/usr/local/gcc-3.3.1 --disable-nls
--enable-languages=c,c++,f77
    Thread model: posix
    gcc version 3.3.1


    $ g++ -v
    Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2.2/specs
    Configured with: ../configure --prefix=/usr --libdir=/usr/lib
--with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking --enable-long-long
--enable-__cxa_atexit --enable-languages=c,c++,ada,f77,objc,java
--host=i586-mandrake-linux-gnu --with-system-zlib
    Thread model: posix
    gcc version 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)

-- 
           Summary: G++ 3.3 fails to match the templatized, overloaded
                    operator for subtypes defined in the class template
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wirawan0 at softhome dot net
                CC: gcc-bugs at gcc dot gnu dot org
 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=13399


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

* [Bug c++/13399] G++ 3.3 fails to match the templatized, overloaded operator for subtypes defined in the class template
  2003-12-14 15:05 [Bug c++/13399] New: G++ 3.3 fails to match the templatized, overloaded operator for subtypes defined in the class template wirawan0 at softhome dot net
@ 2003-12-14 15:07 ` wirawan0 at softhome dot net
  2003-12-15  9:48 ` bangerth at dealii dot org
  1 sibling, 0 replies; 3+ messages in thread
From: wirawan0 at softhome dot net @ 2003-12-14 15:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wirawan0 at softhome dot net  2003-12-14 15:07 -------
Created an attachment (id=5332)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5332&action=view)
The complete sample code to reproduce the error


-- 


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


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

* [Bug c++/13399] G++ 3.3 fails to match the templatized, overloaded operator for subtypes defined in the class template
  2003-12-14 15:05 [Bug c++/13399] New: G++ 3.3 fails to match the templatized, overloaded operator for subtypes defined in the class template wirawan0 at softhome dot net
  2003-12-14 15:07 ` [Bug c++/13399] " wirawan0 at softhome dot net
@ 2003-12-15  9:48 ` bangerth at dealii dot org
  1 sibling, 0 replies; 3+ messages in thread
From: bangerth at dealii dot org @ 2003-12-15  9:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2003-12-15 09:48 -------
gcc is correct, since it can't deduce the template parameter for 
the outer type. The code is invalid. 
 
W. 

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


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


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

end of thread, other threads:[~2003-12-15  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-14 15:05 [Bug c++/13399] New: G++ 3.3 fails to match the templatized, overloaded operator for subtypes defined in the class template wirawan0 at softhome dot net
2003-12-14 15:07 ` [Bug c++/13399] " wirawan0 at softhome dot net
2003-12-15  9:48 ` bangerth at dealii 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).