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

            Bug ID: 44016
           Summary: __declspec(dllexport) ignored on specialized function
                    definitions
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

Created attachment 22817
  --> https://bugs.llvm.org/attachment.cgi?id=22817&action=edit
Example

Please see the attached files. Templated class functions that are specialized,
aren't added to the list of exported functions. In the attached example, any
binary linking to this shared library will fail to find dll<int>::Func().

// dll.hpp
#ifdef DLL_EXPORT
#define DLL_API __declspec(dllexport)
#else
#define DLL_API __declspec(dllimport)
#endif

template <typename T>
struct dll
{
    DLL_API static void Func();
};

// dll.cpp
#define DLL_EXPORT
#include "dll.hpp"

#include <stdio.h>

template <>
void dll<int>::Func()
{
    printf("dll<int>::Func1\n");
}

template class DLL_API dll<int>;

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to