[llvm-bugs] [Bug 32992] New: Static const members in base classes are not dllexported

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 10 09:51:47 PDT 2017


            Bug ID: 32992
           Summary: Static const members in base classes are not
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zahira.ammarguellat at intel.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

clang does not export the static data member of the base class.

ksh-3.2$ cat test.cpp
template <class T>
class Base {
   virtual void foo() {;}
   static const int memberza;

template <class T> const int Base<T>::memberza = 77;

template <class T>
class __declspec(dllexport) Derived2 : Base<T>
   void foo() {;}

class Derived: public Derived2<int> {
   void foo() {;}
ksh-3.2$ cl -c /Zi test.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

ksh-3.2$ dumpbin /directives test.obj | grep -i export | grep member
   /EXPORT:?memberza@?$Base at H@@0HB,DATA
ksh-3.2$ clang -c -g test.cpp
ksh-3.2$ dumpbin /directives test.o | grep -i export | grep member

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/20170510/da663244/attachment.html>

More information about the llvm-bugs mailing list