Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Andreas Schwab Newsgroups: gnu.utils.bug Subject: Re: Bug in the linker Date: Wed, 21 Aug 2019 16:09:33 +0200 Lines: 23 Approved: bug-gnu-utils@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: usenet.stanford.edu 1566396582 19184 209.51.188.17 (21 Aug 2019 14:09:42 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-gnu-utils@gnu.org To: johnny dude Envelope-to: bug-gnu-utils@gnu.org X-Virus-Scanned: amavisd-new at mnet-online.de X-Auth-Info: MUVIcKpcNF5yGP77AItKNFIirRiQL0nQeH7M7ls6OzcQ7F0LmkE0GR52rODHRkob X-Yow: Is something VIOLENT going to happen to a GARBAGE CAN? In-Reply-To: (johnny dude's message of "Wed, 21 Aug 2019 14:59:15 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.18.0.9 X-BeenThere: bug-gnu-utils@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com gnu.utils.bug:2265 On Aug 21 2019, johnny dude wrote: > root@44027fc60f45:/# cat a.cpp > #include > struct A { int n; A(int n) : n(n + 10) {} }; > int a(int n) { return A(n).n; } > extern int b(int n); > int main(int, char**) { std::clog << a(5) << ", " << b(5) << "\n"; } > > root@44027fc60f45:/# cat b.cpp > #include > struct A { int n; A(int n) : n(n + 100) {} }; > int b(int n) { return A(n).n; } This violates basic.def.odr. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."