public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/4973: weird template instantiation
@ 2002-09-15 12:35 nathan
  0 siblings, 0 replies; 2+ messages in thread
From: nathan @ 2002-09-15 12:35 UTC (permalink / raw)
  To: benko, gcc-bugs, gcc-prs, nobody

Synopsis: weird template instantiation

State-Changed-From-To: open->closed
State-Changed-By: nathan
State-Changed-When: Sun Sep 15 12:35:24 2002
State-Changed-Why:
    not a bug. Net<5>::SubNet requires instantiating Net<5>
    (to see what SubNet turns out to be). That instantiates the
    interface of all Net<5>'s functions, which includes
    Net(typename Net<D+1>::SubNet const &), and
    so it'll never terminate

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


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

* c++/4973: weird template instantiation
@ 2001-11-22  7:15 benko
  0 siblings, 0 replies; 2+ messages in thread
From: benko @ 2001-11-22  7:15 UTC (permalink / raw)
  To: gcc-gnats


>Number:         4973
>Category:       c++
>Synopsis:       weird template instantiation
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 30 00:56:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Pal Benko
>Release:        3.0.2
>Organization:
>Environment:
SuSE7.1, i686
>Description:
Compiling the attached program I got

arta:~/c/proba$ /gml/shared/gcc-3.0.2/bin/g++ -Wall -ftemplate-depth-3 templit.cc
templit.cc:20: template instantiation depth exceeds maximum of 3 (use 
   -ftemplate-depth-NN to increase the maximum) instantiating `struct Net<8>'
templit.cc:20:   instantiated from `Net<7>'
templit.cc:20:   instantiated from `Net<6>'
templit.cc:20:   instantiated from `Net<5>'
templit.cc:26:   instantiated from here
templit.cc:20: invalid use of undefined type `struct Net<8>'
templit.cc:3: forward declaration of `struct Net<8>'
templit.cc: In function `int main()':
templit.cc:27: warning: unused variable `Net<4> n'
zsh: exit 1     /gml/shared/gcc-3.0.2/bin/g++ -Wall -ftemplate-depth-3 templit.cc

I think instantiating Net<7> should not be attempted.
>How-To-Repeat:

>Fix:

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

dGVtcGxhdGUgPGludCBEPgpzdHJ1Y3QgTmV0CnsKICBzdHJ1Y3QgU3ViTmV0CiAge307CgogIE5l
dCgpIHt9CiAgTmV0KHR5cGVuYW1lIE5ldDxEKzE+OjpTdWJOZXQgY29uc3QgJik7Cn07CgovLyAg
dGVtcGxhdGUgPD4KLy8gIHN0cnVjdCBOZXQ8NTQ+Ci8vICB7Ci8vICAgIHN0cnVjdCBTdWJOZXQK
Ly8gICAge307Ci8vICB9OwoKdGVtcGxhdGUgPGludCBEPgpOZXQ8RD46Ok5ldChOZXQ8RCsxPjo6
U3ViTmV0IGNvbnN0ICYpCnt9CgoKaW50Cm1haW4oKQp7CiAgTmV0PDU+OjpTdWJOZXQgczsKICBO
ZXQ8ND4gICAgICAgICBuKHMpOwoKICByZXR1cm4gMDsKfQo=


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

end of thread, other threads:[~2002-09-15 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-15 12:35 c++/4973: weird template instantiation nathan
  -- strict thread matches above, loose matches on Subject: below --
2001-11-22  7:15 benko

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