public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "agadethrowaway at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96179] New: g++-10.1 silently doesn't push_back the return of a void function Date: Mon, 13 Jul 2020 08:58:34 +0000 [thread overview] Message-ID: <bug-96179-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96179 Bug ID: 96179 Summary: g++-10.1 silently doesn't push_back the return of a void function Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: agadethrowaway at gmail dot com Target Milestone: --- Created attachment 48866 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48866&action=edit Minimal reproducing example #include <vector> using namespace std; struct dummy{ int a; }; void Modify_Dummy(dummy &d){ d.a=1; } template <bool bla=true> void Templated_Function(){ vector<dummy> A; A.push_back(Modify_Dummy(dummy{0})); } int main(){ Templated_Function(); } Compiled with all: g++-10 Void_Pushback.cpp -o Void_Pushback using: g++-10 (Ubuntu 10-20200411-0ubuntu1) 10.0.1 20200411 (experimental) [master revision bb87d5cc77d:75961caccb7:f883c46b4877f637e0fa5025b4d6b5c9040ec566] Copy of code attached. Code should not compile. The push_back instruction is silently ignored and the vector stays empty.
next reply other threads:[~2020-07-13 8:58 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-13 8:58 agadethrowaway at gmail dot com [this message] 2020-07-13 9:08 ` [Bug c++/96179] [10/11 Regression] " redi at gcc dot gnu.org 2020-07-13 9:19 ` jakub at gcc dot gnu.org 2020-07-13 12:59 ` mpolacek at gcc dot gnu.org 2020-07-13 17:35 ` mpolacek at gcc dot gnu.org 2020-07-14 20:03 ` cvs-commit at gcc dot gnu.org 2020-07-14 23:24 ` cvs-commit at gcc dot gnu.org
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-96179-4@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).