https://bugs.llvm.org/show_bug.cgi?id=38354
Reid Kleckner <r...@google.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|NEW |RESOLVED
--- Comment #1 from Reid Kleckner <r...@google.com> ---
This links successfully without optimizations, but fails with optimizations.
With optimizations, LLVM discards the definition of A<int>::~A in t.obj after
inlining. This is normal for inline functions. Every TU that needs the
definition of an inline function must provide one. This rule exists to allow
each TU to individually discard inline function definitions that are not
needed.
MSVC implements this optimization under /Zc:inline
(https://msdn.microsoft.com/en-us/library/dn642448.aspx), but it is not on by
default for compatibility with code like this.
To fix the code, move the template method definitions into the .h file.
--
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