[llvm-bugs] [Bug 26935] New: [ms][dll] clang is not generating Linker Directives for a destructor of imported class

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 14 02:31:24 PDT 2016


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

            Bug ID: 26935
           Summary: [ms][dll] clang is not generating Linker Directives
                    for a destructor of imported class
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: andrey.kuleshov at intel.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

!- this report is related to a creation of a directive section for dll.
Clang is not generating Linker Directives for a destructor of imported with
__declspec(dllimport) class when this destructor has out-of-class definition. 

Clang emits a warning: 
 warning: 'C3::~C3' redeclared without 'dllimport' attribute: previous  
'dllimport' ignored
      [-Winconsistent-dllimport]  -!

=========Environment=============
OS: Win 
Lang: c++
Version: trunk

=========Reproducer==============
test.cpp
-----------
struct __declspec(dllimport) C3 {
   ~C3();
};

C3::~C3() {;}
-----------

$ cl -c test.cpp /Fomstest.obj
$ clang-cl -c test.cpp /Foclangtest.obj

===========Output================
>>> MSVC (vs2015):
$ dumpbin /directives mstest.obj | grep -i export
   /EXPORT:??1C3@@QEAA at XZ

>>> clang:
$ dumpbin /directives clangtest.obj | grep -i export

-- 
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/20160314/f9586f24/attachment.html>


More information about the llvm-bugs mailing list