https://llvm.org/bugs/show_bug.cgi?id=31695
Bug ID: 31695 Summary: Export attribute on inline template method not ignored Product: clang Version: trunk Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: Driver Assignee: unassignedclangb...@nondot.org Reporter: steve...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Given a header #ifdef BUILDING_LIB #define EXPORT __declspec(dllexport) #else #define EXPORT __declspec(dllimport) #endif namespace MyNS { EXPORT void func(); template<int size = 3> EXPORT inline int someFunc(int input = size); } template<int size> int MyNS::someFunc(int input) { return input * 2; } and trivial source file: #include "export-inline.h" namespace MyNS { void func() { } } and consumer: #include "export-inline.h" int main() { MyNS::func(); int sf = MyNS::someFunc(43); return 0; } and buildsystem: add_library(sh SHARED export-inline.cpp ) target_compile_definitions(sh PRIVATE BUILDING_LIB) add_executable(shconsumer export-consumer.cpp) target_link_libraries(shconsumer sh) clang-cl fails to ignore the export attribute and the link fails. unresolved external symbol "__declspec(dllimport) int __cdecl MyNS::someFunc<3>(int)" (__imp_??$someFunc@$02@MyNS@@YAHH@Z) referenced in function main -- 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