public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: acm@alumni.brown.edu
To: gcc-gnats@gcc.gnu.org
Subject: c++/7745: gcc 3.2 rejects legal member template overload
Date: Wed, 28 Aug 2002 07:56:00 -0000	[thread overview]
Message-ID: <20020828140257.624.qmail@sources.redhat.com> (raw)


>Number:         7745
>Category:       c++
>Synopsis:       gcc 3.2 rejects legal member template overload
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 28 07:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Morrow
>Release:        gcc version 3.2
>Organization:
>Environment:
System: SunOS <sanitized> 5.8 Generic_108528-13 sun4u sparc SUNW,UltraAX-i2
Architecture: sun4
host: sparc-sun-solaris2.8
>Description:
In attached code, the second overload of the member template create in class Factory is rejected in gcc 3.2. This construction was accepted in 3.1 (as well as Forte 6U2 and the comeau online front end) and appears to be legal. Output data:

g++ -v -save-temps member_template_failure.cpp 
Reading specs from /usr/local/software/gcc-3.2/lib/gcc-lib/sparc-sun-solaris2.8/3.2/specs
Configured with: ../../gcc-3.2/configure --prefix=/usr/local/software/gcc-3.2 --enable-languages=c,c++ --disable-nls --enable-shared --enable-threads
Thread model: posix
gcc version 3.2
 /usr/local/software/gcc-3.2/lib/gcc-lib/sparc-sun-solaris2.8/3.2/cpp0 -lang-c++ -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc -D__sun -D__unix -Asystem=unix -Asystem=svr4 -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D__EXTENSIONS__ -D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int -D__WCHAR_TYPE__=long int -D__WINT_TYPE__=long int -D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc member_template_failure.cpp member_template_failure.ii
GNU CPP version 3.2 (cpplib) (sparc ELF)
ignoring nonexistent directory "/usr/local/software/gcc-3.2/sparc-sun-solaris2.8/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/software/gcc-3.2/include/c++/3.2
 /usr/local/software/gcc-3.2/include/c++/3.2/sparc-sun-solaris2.8
 /usr/local/software/gcc-3.2/include/c++/3.2/backward
 /usr/local/include
 /usr/local/software/gcc-3.2/include
 /usr/local/software/gcc-3.2/lib/gcc-lib/sparc-sun-solaris2.8/3.2/include
 /usr/include
End of search list.
 /usr/local/software/gcc-3.2/lib/gcc-lib/sparc-sun-solaris2.8/3.2/cc1plus -fpreprocessed member_template_failure.ii -quiet -dumpbase member_template_failure.cpp -version -o member_template_failure.s
GNU CPP version 3.2 (cpplib) (sparc ELF)
GNU C++ version 3.2 (sparc-sun-solaris2.8)
        compiled by GNU C version 3.2.
member_template_failure.cpp:20: `template<class _Type_, class _Interface_> 
   _Interface_* Factory::create() const' and `template<class _Type_> Interface* 
   Factory::create() const' cannot be overloaded
member_template_failure.cpp:32: prototype for `_Interface_* Factory::create() 
   const' does not match any in class `Factory'
member_template_failure.cpp:17: candidate is: template<class _Type_> Interface* 
   Factory::create() const
member_template_failure.cpp:32: template definition of non-template `
   _Interface_* Factory::create() const'
member_template_failure.cpp: In function `int main(int, char**)':
member_template_failure.cpp:42: no matching function for call to `Factory::
   create()'

>How-To-Repeat:
Compile attached file member_template_failure.cpp. This file does not include any headers, and so is submitted as source, not preprocessed output.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2002-08-28 14:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-28  7:56 acm [this message]
2002-09-13  9:35 lerdsuwa
2002-09-21  4:50 lerdsuwa
2002-10-03  8:08 lerdsuwa
2002-11-01  6:54 lerdsuwa

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=20020828140257.624.qmail@sources.redhat.com \
    --to=acm@alumni.brown.edu \
    --cc=gcc-gnats@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).