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: unassignedclangb...@nondot.org
          Reporter: andrey.kules...@intel.com
                CC: dgre...@apple.com, llvm-bugs@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@XZ

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

-- 
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

Reply via email to