diff options
| author | Hans Wennborg <hans@hanshq.net> | 2014-08-27 21:27:40 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2014-08-27 21:27:40 +0000 |
| commit | dd96db2c034ce7700f4a4943bf148834adca42e7 (patch) | |
| tree | ecfb5452ff7b8e9fffbd17d98272639defc55876 /clang/test/SemaCXX/dllexport.cpp | |
| parent | cdb871d734232e38a5b17e12bdf4d713d6850998 (diff) | |
| download | bcm5719-llvm-dd96db2c034ce7700f4a4943bf148834adca42e7.tar.gz bcm5719-llvm-dd96db2c034ce7700f4a4943bf148834adca42e7.zip | |
Allow adding dll attributes on certain redecls with a warning if the decl hasn't been used yet (PR20746)
This shouldn't really be allowed, but it comes up in real code (see PR). As
long as the decl hasn't been used there's no technical difficulty in supporting
it, so downgrade the error to a warning.
Differential Revision: http://reviews.llvm.org/D5087
llvm-svn: 216619
Diffstat (limited to 'clang/test/SemaCXX/dllexport.cpp')
| -rw-r--r-- | clang/test/SemaCXX/dllexport.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/test/SemaCXX/dllexport.cpp b/clang/test/SemaCXX/dllexport.cpp index 8219c47cd11..df87c737865 100644 --- a/clang/test/SemaCXX/dllexport.cpp +++ b/clang/test/SemaCXX/dllexport.cpp @@ -53,7 +53,7 @@ __declspec(dllexport) extern int GlobalRedecl2; int GlobalRedecl2; extern int GlobalRedecl3; // expected-note{{previous declaration is here}} -__declspec(dllexport) extern int GlobalRedecl3; // expected-error{{redeclaration of 'GlobalRedecl3' cannot add 'dllexport' attribute}} +__declspec(dllexport) extern int GlobalRedecl3; // expected-warning{{redeclaration of 'GlobalRedecl3' should not add 'dllexport' attribute}} // External linkage is required. __declspec(dllexport) static int StaticGlobal; // expected-error{{'StaticGlobal' must have external linkage when declared 'dllexport'}} @@ -186,10 +186,10 @@ __declspec(dllexport) void redecl2(); void redecl2() {} void redecl3(); // expected-note{{previous declaration is here}} -__declspec(dllexport) void redecl3(); // expected-error{{redeclaration of 'redecl3' cannot add 'dllexport' attribute}} +__declspec(dllexport) void redecl3(); // expected-warning{{redeclaration of 'redecl3' should not add 'dllexport' attribute}} void redecl4(); // expected-note{{previous declaration is here}} -__declspec(dllexport) inline void redecl4() {} // expected-error{{redeclaration of 'redecl4' cannot add 'dllexport' attribute}} +__declspec(dllexport) inline void redecl4() {} // expected-warning{{redeclaration of 'redecl4' should not add 'dllexport' attribute}} // Friend functions struct FuncFriend { @@ -200,8 +200,8 @@ struct FuncFriend { }; __declspec(dllexport) void friend1() {} void friend2() {} -__declspec(dllexport) void friend3() {} // expected-error{{redeclaration of 'friend3' cannot add 'dllexport' attribute}} -__declspec(dllexport) inline void friend4() {} // expected-error{{redeclaration of 'friend4' cannot add 'dllexport' attribute}} +__declspec(dllexport) void friend3() {} // expected-warning{{redeclaration of 'friend3' should not add 'dllexport' attribute}} +__declspec(dllexport) inline void friend4() {} // expected-warning{{redeclaration of 'friend4' should not add 'dllexport' attribute}} // Implicit declarations can be redeclared with dllexport. __declspec(dllexport) void* operator new(__SIZE_TYPE__ n); |

