<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - dllimported symbols for pure virtual"
href="https://bugs.llvm.org/show_bug.cgi?id=32990">32990</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>dllimported symbols for pure virtual
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zahira.ammarguellat@intel.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>CL and clang have different behavior for dllimport of pure virtual.
ksh-3.2$ cat test.cpp
class IVirtualBase
{
public:
virtual ~IVirtualBase(){};
virtual void speak() = 0;
};
class VirtualClass : public virtual IVirtualBase
{
public:
virtual ~VirtualClass(){};
virtual void eat() = 0;
};
class __declspec(dllimport) ConcreteClass : public VirtualClass
{
public:
ConcreteClass(int nn);
void speak();
void eat();
private:
int n;
};
int main()
{
ConcreteClass c(10);
c.speak();
c.eat();
return 0;
}
ksh-3.2$
ksh-3.2$ cl -c -Od test.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
test.cpp
ksh-3.2$ dumpbin /symbols test.obj | grep dllimport
008 00000000 UNDEF notype External |
__imp_??0ConcreteClass@@QEAA@H@Z (__d
eclspec(dllimport) public: __cdecl ConcreteClass::ConcreteClass(int))
009 00000000 UNDEF notype External |
__imp_?speak@ConcreteClass@@UEAAXXZ (
__declspec(dllimport) public: virtual void __cdecl ConcreteClass::speak(void))
00A 00000000 UNDEF notype External |
__imp_?eat@ConcreteClass@@UEAAXXZ (__
declspec(dllimport) public: virtual void __cdecl ConcreteClass::eat(void))
00B 00000000 UNDEF notype External |
__imp_??_DConcreteClass@@QEAAXXZ (__d
eclspec(dllimport) public: void __cdecl ConcreteClass::`vbase
destructor'(void))
ksh-3.2$
ksh-3.2$ clang -c -g test.cpp
ksh-3.2$ dumpbin /symbols test.o | grep dllimport
02B 00000000 UNDEF notype External |
__imp_??0ConcreteClass@@QEAA@H@Z (__d
eclspec(dllimport) public: __cdecl ConcreteClass::ConcreteClass(int))
02C 00000000 UNDEF notype External |
__imp_?speak@ConcreteClass@@UEAAXXZ (
__declspec(dllimport) public: virtual void __cdecl ConcreteClass::speak(void))
02D 00000000 UNDEF notype External |
__imp_?eat@ConcreteClass@@UEAAXXZ (__
declspec(dllimport) public: virtual void __cdecl ConcreteClass::eat(void))
033 00000000 UNDEF notype External | __imp_??1ConcreteClass@@UEAA@XZ
(__de
clspec(dllimport) public: virtual __cdecl ConcreteClass::~ConcreteClass(void))
ksh-3.2$</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>