public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/9510: Compilation fails when calling member function templated on integer
@ 2003-02-03 20:08 bangerth
  0 siblings, 0 replies; 5+ messages in thread
From: bangerth @ 2003-02-03 20:08 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, morgan, nobody

Synopsis: Compilation fails when calling member function templated on integer

State-Changed-From-To: analyzed->closed
State-Changed-By: bangerth
State-Changed-When: Mon Feb  3 20:08:56 2003
State-Changed-Why:
    A duplicate of 9549 in every respect: the spurious requirement
    of the template keyword, and the ICE with present mainline.
    9459 contains more information, so I close this one despite
    it being older.
    
    W.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9510


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

* Re: c++/9510: Compilation fails when calling member function templated on integer
@ 2003-02-03 20:04 bangerth
  0 siblings, 0 replies; 5+ messages in thread
From: bangerth @ 2003-02-03 20:04 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, morgan, nobody

Synopsis: Compilation fails when calling member function templated on integer

State-Changed-From-To: closed->analyzed
State-Changed-By: bangerth
State-Changed-When: Mon Feb  3 20:04:42 2003
State-Changed-Why:
    Is indeed a bug. See the long discussion in PR 9549.
    
    Sorry for the confusion -- I should get the final version
    of the standard, I guess.
    
    W.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9510


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

* Re: c++/9510: Compilation fails when calling member function templated on integer
@ 2003-02-02 19:26 Martin Sebor
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Sebor @ 2003-02-02 19:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Martin Sebor <sebor@roguewave.com>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/9510: Compilation fails when calling member function templated
 on integer
Date: Sun, 02 Feb 2003 12:15:05 -0700

 bangerth@dealii.org wrote:
 > Synopsis: Compilation fails when calling member function templated on integer
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: bangerth
 > State-Changed-When: Sat Feb  1 20:42:44 2003
 > State-Changed-Why:
 >     Not a bug. You need to write
 >       ms.template TemplatedMemberFunction<I_>
 >          ^^^^^^^^
 >     since the expression is template parameter dependent.
 
 ms does not depend on a template parameter, so there is no
 need for the .template suffix. It is a well-known gcc bug
 to require the redundant template keyword here (possibly
 fixed by the recent parser changes).
 
 Regards
 Martin
 
 >     
 >       Wolfgang
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9510
 


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

* Re: c++/9510: Compilation fails when calling member function templated on integer
@ 2003-02-01 20:42 bangerth
  0 siblings, 0 replies; 5+ messages in thread
From: bangerth @ 2003-02-01 20:42 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, morgan, nobody

Synopsis: Compilation fails when calling member function templated on integer

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Sat Feb  1 20:42:44 2003
State-Changed-Why:
    Not a bug. You need to write
      ms.template TemplatedMemberFunction<I_>
         ^^^^^^^^
    since the expression is template parameter dependent.
    
      Wolfgang

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9510


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

* c++/9510: Compilation fails when calling member function templated on integer
@ 2003-01-30 17:36 morgan
  0 siblings, 0 replies; 5+ messages in thread
From: morgan @ 2003-01-30 17:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9510
>Category:       c++
>Synopsis:       Compilation fails when calling member function templated on integer
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 30 17:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     morgan@sten.sunnybrook.utoronto.ca
>Release:        version 3.2
>Organization:
>Environment:
Mandrake Linux 9.0
>Description:
Following code fails to compile when trying to pass an integer template parameter to a templated member function.  (This compiles succesfully on MSVC 7)


struct MyStruct
{
	template <int I_>
	int TemplatedMemberFunction()
	{
		return I_;
	}
};

template <int I_>
void TemplatedFunction()
{
	MyStruct ms;
	ms.TemplatedMemberFunction<1>();//doesn't compile.
	ms.TemplatedMemberFunction<I_>();//doesn't compile.
};

int main(int argc , char** argv)
{
	MyStruct ms;
	ms.TemplatedMemberFunction<1>();//compiles.
	TemplatedFunction<1>();			//compiles
	return 0;
}
>How-To-Repeat:
try compiling above code with g++
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="templates.ii"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="templates.ii"

IyAxICJ0ZW1wbGF0ZXMuY2MiCiMgMSAiPGJ1aWx0LWluPiIKIyAxICI8Y29tbWFuZCBsaW5lPiIK
IyAxICJ0ZW1wbGF0ZXMuY2MiCnN0cnVjdCBNeVN0cnVjdAp7CiAgICAgICAgdGVtcGxhdGUgPGlu
dCBJXz4KICAgICAgICBpbnQgVGVtcGxhdGVkTWVtYmVyRnVuY3Rpb24oKQogICAgICAgIHsKICAg
ICAgICAgICAgICAgIHJldHVybiBJXzsKICAgICAgICB9Cn07Cgp0ZW1wbGF0ZSA8aW50IElfPgp2
b2lkIFRlbXBsYXRlZEZ1bmN0aW9uKCkKewogICAgICAgIE15U3RydWN0IG1zOwogICAgICAgIG1z
LlRlbXBsYXRlZE1lbWJlckZ1bmN0aW9uPDE+KCk7CiAgICAgICAgbXMuVGVtcGxhdGVkTWVtYmVy
RnVuY3Rpb248SV8+KCk7Cn07CgppbnQgbWFpbihpbnQgYXJnYyAsIGNoYXIqKiBhcmd2KQp7CiAg
ICAgICAgTXlTdHJ1Y3QgbXM7CiAgICAgICAgbXMuVGVtcGxhdGVkTWVtYmVyRnVuY3Rpb248MT4o
KTsKICAgICAgICBUZW1wbGF0ZWRGdW5jdGlvbjwxPigpOwogICAgICAgIHJldHVybiAwOwp9Cg==


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

end of thread, other threads:[~2003-02-03 20:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-03 20:08 c++/9510: Compilation fails when calling member function templated on integer bangerth
  -- strict thread matches above, loose matches on Subject: below --
2003-02-03 20:04 bangerth
2003-02-02 19:26 Martin Sebor
2003-02-01 20:42 bangerth
2003-01-30 17:36 morgan

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