Downgrade "definition of dllimport static field" error to warning for class templates...
authorHans Wennborg <hans@hanshq.net>
Wed, 4 Jun 2014 00:18:41 +0000 (00:18 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 4 Jun 2014 00:18:41 +0000 (00:18 +0000)
commite9af3164237f16a35e6f57c06f09b20cb7b4b622
tree4eb060352c9e8fea1fb072d2fda4b450ce15b3ac
parent547f536bcf6a29ffd63b5f921c5c15732e17dd19
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
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaDecl.cpp
clang/test/CodeGenCXX/dllimport.cpp
clang/test/SemaCXX/dllimport.cpp