diff options
author | Hans Wennborg <hans@hanshq.net> | 2015-09-04 19:59:39 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2015-09-04 19:59:39 +0000 |
commit | 5427a695453c85a45a0d92c892e3f3c25885fe18 (patch) | |
tree | bd529451f4b0943886d25fa11974d2cf16488647 /clang/test/SemaCXX/dllimport.cpp | |
parent | 0fccef6ac2fc87f4dd29a1d098723cd2869a09ab (diff) | |
download | bcm5719-llvm-5427a695453c85a45a0d92c892e3f3c25885fe18.tar.gz bcm5719-llvm-5427a695453c85a45a0d92c892e3f3c25885fe18.zip |
Don't allow dllexport/import on static local variables
They might technically have external linkage, but it still doesn't make sense
for the user to try and export such variables. This matches MSVC's and MinGW's
behaviour.
llvm-svn: 246864
Diffstat (limited to 'clang/test/SemaCXX/dllimport.cpp')
-rw-r--r-- | clang/test/SemaCXX/dllimport.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/clang/test/SemaCXX/dllimport.cpp b/clang/test/SemaCXX/dllimport.cpp index f17c2e22414..91ed6b42606 100644 --- a/clang/test/SemaCXX/dllimport.cpp +++ b/clang/test/SemaCXX/dllimport.cpp @@ -93,16 +93,10 @@ __declspec(dllimport) auto InternalAutoTypeGlobal = Internal(); // expected-erro // Thread local variables are invalid. __declspec(dllimport) __thread int ThreadLocalGlobal; // expected-error{{'ThreadLocalGlobal' cannot be thread local when declared 'dllimport'}} -inline void InlineWithThreadLocal() { - static __declspec(dllimport) __thread int ThreadLocalGlobal; // expected-error{{'ThreadLocalGlobal' cannot be thread local when declared 'dllimport'}} -} - -// But if they're in a dllimported function, it's OK because we will not inline the function. // This doesn't work on MinGW, because there, dllimport on the inline function is ignored. #ifndef GNU inline void __declspec(dllimport) ImportedInlineWithThreadLocal() { - static __declspec(dllimport) __thread int OK1; // no-error - static __thread int OK2; // no-error + static __thread int OK; // no-error } #endif |