[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in the linker
From: |
Andreas Schwab |
Subject: |
Re: Bug in the linker |
Date: |
Wed, 21 Aug 2019 16:09:33 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) |
On Aug 21 2019, johnny dude <address@hidden> 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, address@hidden
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."