This replaces D145271.
Rather than coercing classes with UniqueExternalLInkage to ExternalLinkage as proposed in D145271, this patch suggests to simply allow the dllexport/dllimport attributes for classes that exhibit UniqueExternalLinkage, which includes instantiations of template classes where the template parameters are local classes or classes in anonymous namespaces:
template <typename T> class __declspec(dllimport) A {}; void func() { class B : public A<B> {}; } namespace { class C : public A<C> {}; }
In D145271 it was suggested that we drop the attribute in such contexts, and this is effectively what happens. The compiler does not produce any exported definitions (or import any symbols) for such classes. The patch is simply to suppress the diagnostic for MSVC mode and Playstation.
I have not changed the behavior of the Windows/Itanium triple since I wasn't sure if this was desirable.
Is this one used somewhere?