public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3614: failing overloading of template member functions in template classes
@ 2002-11-21 19:06 Wolfgang Bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Bangerth @ 2002-11-21 19:06 UTC (permalink / raw)
  To: gdr; +Cc: gcc-prs

The following reply was made to PR c++/3614; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/3614: failing overloading of template member functions in
 template classes
Date: Fri, 15 Nov 2002 20:10:17 -0600 (CST)

 May be related to PR 509.
 
 The problem also got worse. With 3.3 CVS from 2002-11-10, I get
 x.cc:15: error: redefinition of `int A<N>::f()'
 x.cc:12: error: `int A<N>::f()' previously declared here
 x.cc:15: error: no `int A<N>::f()' member function declared in class `A<N>'
 x.cc:15: error: expected 2 levels of template parms for `int A<N>::f()', got 1
 x.cc: In instantiation of `A<42>':
 x.cc:19:   instantiated from here
 x.cc:7: internal compiler error: in retrieve_specialization, at cp/pt.c:727
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
 
 Also, the circular error messages are not very helpful (redefinition -- 
 not existing -- but expecting something from it; no what?)
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 


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

* Re: c++/3614: failing overloading of template member functions in template classes
@ 2001-08-12  4:04 gdr
  0 siblings, 0 replies; 3+ messages in thread
From: gdr @ 2001-08-12  4:04 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, gdr, nobody, sts

Synopsis: failing overloading of template member functions in template classes

Responsible-Changed-From-To: unassigned->gdr
Responsible-Changed-By: gdr
Responsible-Changed-When: Sun Aug 12 04:04:29 2001
Responsible-Changed-Why:
    See below.
State-Changed-From-To: open->analyzed
State-Changed-By: gdr
State-Changed-When: Sun Aug 12 04:04:29 2001
State-Changed-Why:
    Confirmed as a bug.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3614&database=gcc


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

* c++/3614: failing overloading of template member functions in template classes
@ 2001-07-09  2:56 sts
  0 siblings, 0 replies; 3+ messages in thread
From: sts @ 2001-07-09  2:56 UTC (permalink / raw)
  To: gcc-gnats

>Number:         3614
>Category:       c++
>Synopsis:       failing overloading of template member functions in template classes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 09 02:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     sts@ica1.uni-stuttgart.de
>Release:        gcc-3.0
>Organization:
>Environment:
alpha OSF 5.0, ix86-linux
>Description:
// I cannot see a problem with the syntax of the following 
// fragment; shouldn't one be able to overload template and 
// non-template functions in class scopes and be able to declare 
// them out of line?  From the examples in Sec. 14 of the standard
// my guess is that the fragment below uses the syntax intended for 
// this purpose. EDG compilers treat this fragment as I expect (the 
// executable returns 0 to the environent)

// the _inline_ definition of the functions IN the class 
// body works as expected

// Stefan Schwarzer sts@ica1.uni-stuttgart.de

// 11:30 tiger_sts:gnu/current> g++ -v
// Reading specs from /local/gcc-3.0/lib/gcc-lib/alphaev56-dec-osf4.0f/3.0/specs
// Configured with: /share/src/gcc-3.0/configure --prefix=/local/gcc-3.0 --host=
alphaev56-dec-osf4.0f --target=alphaev56-dec-osf4.0f
// Thread model: single
// gcc version 3.0

// 11:30 tiger_sts:gnu/current> g++ class_tmpl_ovld.cc
// class_tmpl_ovld.cc:28: redefinition of `int A<N>::f()'
// class_tmpl_ovld.cc:25: `int A<N>::f()' previously declared here
// class_tmpl_ovld.cc:28: expected 2 levels of template parms for `int A<N>::f()
', 
//   got 1
// class_tmpl_ovld.cc:20: confused by earlier errors, bailing out



template<int N>
struct A {

  int f();  

  template<int M>
  int f();

};

template<int N> template<int M>
int A<N>::f(){ return M; } 

template<int N>
int A<N>::f(){ return 1; }

// should compile and return 0
int main(){
  A<42> a;
  return a.f<0>();
}
>How-To-Repeat:
see problem description
>Fix:

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


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

end of thread, other threads:[~2002-11-16  2:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-21 19:06 c++/3614: failing overloading of template member functions in template classes Wolfgang Bangerth
  -- strict thread matches above, loose matches on Subject: below --
2001-08-12  4:04 gdr
2001-07-09  2:56 sts

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