public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "tangyixuan at mail dot dlut.edu.cn" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96975] New: gcc cannot compile at -O0 but compiles at -O1/-O2/-O3 Date: Tue, 08 Sep 2020 11:27:09 +0000 [thread overview] Message-ID: <bug-96975-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96975 Bug ID: 96975 Summary: gcc cannot compile at -O0 but compiles at -O1/-O2/-O3 Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code is not compiled with -O0, but is compiled with -O1/O2/O3. $ cat s.cpp typedef void (* A )(); template < A T > struct S { S (){}}; void T (){} S < T > a ; int main (){ void T (); S < T > a ; } $ g++ -c -O0 s.cpp /tmp/cc1wgC6C.s:73: Error: symbol `_ZN14CXXRecordDeclAIXadL_Z13FunctionDeclAvEEEC2Ev' is already defined $ g++ -c -O2 s.cpp success. $ clang++ -c -O0 s.cpp success.
next reply other threads:[~2020-09-08 11:27 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-09-08 11:27 tangyixuan at mail dot dlut.edu.cn [this message] 2020-09-08 13:05 ` [Bug c++/96975] " rguenth at gcc dot gnu.org 2020-09-11 13:08 ` mpolacek 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-96975-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).