https://llvm.org/bugs/show_bug.cgi?id=24648
Richard Smith <richard-l...@metafoo.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |richard-l...@metafoo.co.uk Resolution|--- |INVALID --- Comment #1 from Richard Smith <richard-l...@metafoo.co.uk> --- If you want to define a structure for internal-only consumption, you need to give it internal linkage (wrap it in an anonymous namespace). Otherwise, your program is ill-formed (no diagnostic required) due to an ODR violation, which leads to undefined behavior at runtime in this case. The difference you're seeing here is unrelated to visibility -- that affects DSO boundaries, and in this case you linked the two object files into the same binary. The difference is simply that LLVM's inliner chose not to inline the operator[] function. You'll probably see the same thing with the other compilers if you turn off optimization (or maybe if you link the object files in the opposite order). -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs