compnerd added a comment. BTW, I think that this is sufficient to show the behavior in MSVC: struct S { ~S(); }; void g(); __declspec(dllexport) void f() { S s; g(); } https://reviews.llvm.org/D38940