public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: "Giovanni Bajo" <giovannibajo@libero.it> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c++/10527: Internal error during template compile Date: Tue, 29 Apr 2003 10:46:00 -0000 [thread overview] Message-ID: <20030429104602.31619.qmail@sources.redhat.com> (raw) The following reply was made to PR c++/10527; it has been noted by GNATS. From: "Giovanni Bajo" <giovannibajo@libero.it> To: <gcc-gnats@gcc.gnu.org>, <Endlisnis@mailc.net>, <gcc-bugs@gcc.gnu.org>, <rcampbell@tropicnetworks.com>, <nobody@gcc.gnu.org>, <gcc-prs@gcc.gnu.org> Cc: "Wolfgang Bangerth" <bangerth@ices.utexas.edu> Subject: Re: c++/10527: Internal error during template compile Date: Tue, 29 Apr 2003 12:45:06 +0200 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p r=10527 Confirmed. Reduced snippet is: ------------------------------------------------------------ template <class T> struct Foo {}; template <class T> void Foo<T>::NON_EXISTENT(int* val = new int()) {} ------------------------------------------------------------ pr10527.cpp:7: error: no ` Internal compiler error: Error reporting routines re-entered. Please submit a full bug report, This is ice-on-illegal-code, 3.3/3.4 regression with respect to 2.95 where the same code shows a correct error message. Note that if Foo is a normal class, the ICE disappears but the error message is _ugly_: ------------------------------------------------------------ struct Foo {}; void Foo::NON_EXISTENT(int* val = new int()) {} ------------------------------------------------------------ pr10527.cpp:5: error: no `void Foo::NON_EXISTENT(int* = (operator new(unsigned int)(4), ((true, (((*<anonymous>) <unknown operator> 0), (<anonymous> <unknown operator> false))), <anonymous>)))' member function declared in class `Foo' For the original poster, your code is illegal for several reasons. First, the parameter list of your makeQueryHandler() function at definition time does not match the parameter list at declaration time. Then, if you want to define a template member function of a template class outside the class definition, the syntax you must use is the following: template <class-template-parameters> struct Foo { template <memfun-template-parameters> void func(..........); }; template <class-template-parameters> template <memfun-template-paramters> void Foo<class-template-parameter-names>::func(.......) { ..... } Hope this helps Giovanni Bajo
next reply other threads:[~2003-04-29 10:46 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-04-29 10:46 Giovanni Bajo [this message] -- strict thread matches above, loose matches on Subject: below -- 2003-04-28 21:46 rcampbell
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=20030429104602.31619.qmail@sources.redhat.com \ --to=giovannibajo@libero.it \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@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: linkBe 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).