[llvm-bugs] [Bug 24291] clang-cl imports an incorrect data symbol for dllimported classes inside a namespace with a default ctor which have a local static member

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 8 09:43:52 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=24291

Reid Kleckner <rnk at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #13 from Reid Kleckner <rnk at google.com> ---
(In reply to comment #12)
> (FWIW I would be fine working around this in Firefox if you think this is
> not worth changing clang-cl for.)

Yeah, after playing around with MSVC for a bit, my feeling is that this is
working as intended.

We could try to make it easier for users to do delay loading, but there are
many other patterns that will cause MSVC to inline references to dllimport
data. In this example, they inline the ctor and form a reference to the
imported vftable:

struct __declspec(dllimport) S {
  S() {}
  virtual void f();
};
S *create() { return new S(); }

If I wanted to delay load S with MSVC, I'd have to mark S() noinline or move it
out of line. With either compiler, the user has to do some auditing of headers
if they want to use delay loading.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160208/e6b6ead8/attachment.html>


More information about the llvm-bugs mailing list