public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "Raimund dot Merkert at baesystems dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/25814] New: Request for new warning Date: Tue, 17 Jan 2006 00:42:00 -0000 [thread overview] Message-ID: <bug-25814-5307@http.gcc.gnu.org/bugzilla/> (raw) I'd like to request a warning to notify that a statement like "X x(const Y&)" is parsed as function declaration and not a definition of variable x. See the code below. At least as couple of PRs have been filed (9217,19503) on this topic. I've just spent at least 2 hrs trying to figure out why my constructor and destructor were not called and did not show up in the assembly code either. I think this particular problem might affect users that use the resource-acquisition idiom. The real problem is that the code compiles and links and runs without problems, except it doesn't actually work. #include <cstdio> struct Y {}; struct X { inline X (const Y&) {} inline ~X () { ::std::printf("1\n"); } }; int main() { X x(Y()); return 0; } -- Summary: Request for new warning Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Raimund dot Merkert at baesystems dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25814
next reply other threads:[~2006-01-17 0:42 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-01-17 0:42 Raimund dot Merkert at baesystems dot com [this message] 2006-01-17 0:58 ` [Bug c++/25814] Request for warning for parser ambiguity of function declarations and variable declarations with initializations pinskia at gcc dot gnu dot org 2006-01-17 4:01 ` gdr at cs dot tamu dot edu 2006-01-17 12:33 ` Raimund dot Merkert at baesystems dot com 2006-02-02 19:54 ` pinskia at gcc dot gnu dot org 2006-03-08 5:07 ` bangerth at dealii dot org 2006-11-14 15:36 ` wolfgang dot roemer at gmx dot net 2006-11-14 15:52 ` Raimund dot Merkert at baesystems dot com
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=bug-25814-5307@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).