]> granicus.if.org Git - clang/commit
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)
commitcc15d731ca100cddd24494d5c6738da8daf8131d
treea0f68929dc8dfa3566ae90ad79b15edd1d9d7021
parentfb9e1524b7c546b1e88647eef43f5fbc7906ab79
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210141 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDecl.cpp
test/CodeGenCXX/dllimport.cpp
test/SemaCXX/dllimport.cpp