Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > gnu.utils.bug > #2265

Re: Bug in the linker

From Andreas Schwab <schwab@linux-m68k.org>
Newsgroups gnu.utils.bug
Subject Re: Bug in the linker
Date 2019-08-21 16:09 +0200
Message-ID <mailman.587.1566396581.30381.bug-gnu-utils@gnu.org> (permalink)
References <CAKSZggjeNyRv_f+Wc_E4VpnQSZCKsQi8LgxmzMBbDzwJE2vDBA@mail.gmail.com> <mvmpnkyip9e.fsf@linux-m68k.org>

Show all headers | View raw


On Aug 21 2019, johnny dude <johnny.dude@gmail.com> wrote:

> root@44027fc60f45:/# cat a.cpp
> #include <iostream>
> 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 <iostream>
> 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."

Back to gnu.utils.bug | Previous | Next | Find similar


Thread

Re: Bug in the linker Andreas Schwab <schwab@linux-m68k.org> - 2019-08-21 16:09 +0200

csiph-web