HomePhabricator

Downgrade "definition of dllimport static field" error to warning for class…

Authored by hansw on Jun 3 2014, 5:18 PM.

Description

Downgrade "definition of dllimport static field" error to warning for class templates (PR19902)

This allows us to compile the following kind of code, which occurs in MSVC
headers:

template <typename> struct S {
  __declspec(dllimport) static int x;
};
template <typename T> int S<T>::x;

The definition works similarly to a dllimport inline function definition and
gets available_externally linkage.

Differential Revision: http://reviews.llvm.org/D3998

llvm-svn: 210141