Don't assert on different DLL attributes in template and explicit instantiation (PR20137)
We would previously assert (a decl cannot have two DLL attributes) on this code:
template <typename T> struct __declspec(dllimport) S { T f() { return T(); } };
template struct __declspec(dllexport) S<int>;
The problem was that when instantiating, we would take the attribute from the
template even if the instantiation itself already had an attribute.
Also, don't inherit DLL attributes from the template to its members before
instantiation, as the attribute may change.
I couldn't figure out what MinGW does here, so I'm leaving that open. At least
we're not asserting anymore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216340
91177308-0d34-0410-b5e6-
96231b3b80d8