Relands r260194 with a fix. If we have a template that transitions from an extern template to an explicitly instantiated dllexport template, we would add that class to the delayed exported class list without flushing it. For explicit instantiations, we can just flush the list of delayed classes immediately. We don't have to worry about the bug fixed in r260194 in this case because explicit instantiations can only occur at file and namespace scope. Fixes PR26490. llvm-svn: 262056
10 lines
454 B
C++
10 lines
454 B
C++
// RUN: %clang_cc1 %s -fms-extensions -triple x86_64-windows-msvc -emit-llvm -o - | FileCheck %s
|
|
|
|
template <typename> struct MessageT { };
|
|
extern template struct MessageT<int>;
|
|
|
|
// CHECK: define weak_odr dllexport {{.*}} %struct.MessageT* @"\01??4?$MessageT@H@@QEAAAEAU0@AEBU0@@Z"(
|
|
template struct __declspec(dllexport) MessageT<int>;
|
|
// Previously we crashed when this dllexport was the last thing in the file.
|
|
// DO NOT ADD MORE TESTS AFTER THIS LINE!
|