public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: whitley@bangpath.org To: gcc-gnats@gcc.gnu.org Subject: c++/3086: Suggested extension to a template related warning. Date: Fri, 08 Jun 2001 13:56:00 -0000 [thread overview] Message-ID: <20010608204953.18303.qmail@sourceware.cygnus.com> (raw) >Number: 3086 >Category: c++ >Synopsis: Suggested extension to a template related warning. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: change-request >Submitter-Id: net >Arrival-Date: Fri Jun 08 13:56:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: John Whitley >Release: gcc version 2.95.4 20010604 (Debian prerelease) >Organization: >Environment: Current (as of about 7/7/2001) Debian unstable Linux i386 box >Description: This report also applies to the following gcc 3.0 version: Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-x --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux Thread model: posix gcc version 3.0 20010526 (Debian prerelease) A declaration such as "stack<stack<int>>" will correctly issue the warning: "`>>' should be `> >' in template class name" However, the attached sample code fails to emit this very helpful warning, instead producing a rather inscrutable error (for gcc 2.95.4 -- the warning differs slightly for gcc 3.0, but appears to have the same meaning.) The erroneous declaration (from line 37) is: Handle<MyPrivateData<FOO>> handle(pd); Which produces the error message. param_templ2.cpp: In function `int main()': param_templ2.cpp:37: implicit declaration of function `int handle(...)' [...] Hopefully the attached file will be helpful in extending the above warning to cover more cases. Thanks for the great compilers! -- John Whitley >How-To-Repeat: g++ param_templ2.cpp >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/cpp; name="param_templ2.cpp" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="param_templ2.cpp" I2luY2x1ZGUgPHN0ZGlvLmg+Cgp0ZW1wbGF0ZSA8Y2xhc3MgVD4KY2xhc3MgSGFuZGxlCnsKcHVi bGljOgogIEhhbmRsZShUJiBfcmVmKSA6IHJlZihfcmVmKSB7fQoKICBpbnQgZ2V0WChpbnQgaSkg eyByZXR1cm4gcmVmLlhbaV07IH0KCiAgaW50IGdldFkoaW50IGkpIHsgcmV0dXJuIHJlZi5ZW2ld OyB9Cgpwcml2YXRlOgogIFQmIHJlZjsKfTsKCgp0ZW1wbGF0ZSA8aW50IE4+CmNsYXNzIE15UHJp dmF0ZURhdGEKewpwdWJsaWM6CiAgTXlQcml2YXRlRGF0YSgpIHsgZm9yIChpbnQgaSA9IDA7IGkg PCBOOyBpKyspIHsgWFtpXSA9IDQqKFlbaV0gPSBpKjIpOyB9IH0KICAKcHJpdmF0ZToKICB0ZW1w bGF0ZSA8Y2xhc3MgVD4gZnJpZW5kIGNsYXNzIEhhbmRsZTsKCiAgaW50IFhbTl07CiAgaW50IFlb Tl07Cn07CgppbnQgbWFpbigpCnsKICBzdGF0aWMgY29uc3QgaW50IEZPTyA9IDU7CgogIE15UHJp dmF0ZURhdGE8Rk9PPiBwZDsKCiAgSGFuZGxlPE15UHJpdmF0ZURhdGE8Rk9PPj4gaGFuZGxlKHBk KTsKCiAgZm9yIChpbnQgaSA9IDA7IGkgPCBGT087IGkrKykKICAgIHByaW50ZigiWFslZF0gaXMg JWQuICBZWyVkXSBpcyAlZC5cbiIsIGksIGhhbmRsZS5nZXRYKGkpLCBpLCBoYW5kbGUuZ2V0WShp KSk7Cgp9Cg==
reply other threads:[~2001-06-08 13:56 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20010608204953.18303.qmail@sourceware.cygnus.com \ --to=whitley@bangpath.org \ --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: 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).