diff options
author | Reid Kleckner <rnk@google.com> | 2016-02-26 19:51:02 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-02-26 19:51:02 +0000 |
commit | 52f870716dd60f48db8803756c63e4e705d5b0c1 (patch) | |
tree | 6473cd2357373a81fd90ad491db99c50890fdc96 /test/CodeGenCXX/dllexport.cpp | |
parent | c2b042f2f751cb7cf79b0a3dde54b281192456dc (diff) |
[dllexport] Sort out emission order of delayed exported classes
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262056 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/dllexport.cpp')
-rw-r--r-- | test/CodeGenCXX/dllexport.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenCXX/dllexport.cpp b/test/CodeGenCXX/dllexport.cpp index 1412ad866b..04007e8212 100644 --- a/test/CodeGenCXX/dllexport.cpp +++ b/test/CodeGenCXX/dllexport.cpp @@ -777,6 +777,17 @@ struct __declspec(dllexport) Baz { // M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable(1) %"struct.InClassInits::Baz"* @"\01??4Baz@InClassInits@@QAEAAU01@ABU01@@Z" } +// We had an issue where instantiating A would force emission of B's delayed +// exported methods. +namespace pr26490 { +template <typename T> struct A { }; +struct __declspec(dllexport) B { + B(int = 0) {} + A<int> m_fn1() {} +}; +// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??_FB@pr26490@@QAEXXZ" +} + //===----------------------------------------------------------------------===// // Classes with template base classes |