[llvm-branch-commits] [cfe-branch] r221253 - Merging r220874:
Hans Wennborg
hans at hanshq.net
Tue Nov 4 01:47:46 PST 2014
Author: hans
Date: Tue Nov 4 03:47:45 2014
New Revision: 221253
URL: http://llvm.org/viewvc/llvm-project?rev=221253&view=rev
Log:
Merging r220874:
------------------------------------------------------------------------
r220874 | hans | 2014-10-29 14:20:57 -0700 (Wed, 29 Oct 2014) | 3 lines
Follow-up to r216619: use isCXXCLassMember() instead of trying to
check the context ourselves when selectively allowing late-added
dll attributes on unused free functions and variables (PR20746)
------------------------------------------------------------------------
Modified:
cfe/branches/release_35/ (props changed)
cfe/branches/release_35/lib/Sema/SemaDecl.cpp
cfe/branches/release_35/test/Analysis/MismatchedDeallocator-checker-test.mm (props changed)
cfe/branches/release_35/test/Analysis/NewDelete-checker-test.cpp (props changed)
cfe/branches/release_35/test/SemaCXX/dllexport.cpp
cfe/branches/release_35/test/SemaCXX/dllimport.cpp
cfe/branches/release_35/test/SemaCXX/warn-unreachable.cpp (props changed)
Propchange: cfe/branches/release_35/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 4 03:47:45 2014
@@ -1,4 +1,4 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:213609,213611,213613,213741,213834,213840,213902,213912-213913,213993,213998-213999,214008,214050,214060,214119,214208,214222,214369,214390,214471,214734-214735,214777,215046,215229,215245,215609,215618,215806-215808,216531,216572,216619
+/cfe/trunk:213609,213611,213613,213741,213834,213840,213902,213912-213913,213993,213998-213999,214008,214050,214060,214119,214208,214222,214369,214390,214471,214734-214735,214777,215046,215229,215245,215609,215618,215806-215808,216531,216572,216619,220874
/cfe/trunk/test:170344
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/release_35/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_35/lib/Sema/SemaDecl.cpp?rev=221253&r1=221252&r2=221253&view=diff
==============================================================================
--- cfe/branches/release_35/lib/Sema/SemaDecl.cpp (original)
+++ cfe/branches/release_35/lib/Sema/SemaDecl.cpp Tue Nov 4 03:47:45 2014
@@ -5042,7 +5042,7 @@ static void checkDLLAttributeRedeclarati
// If the declaration hasn't been used yet, allow with a warning for
// free functions and global variables.
bool JustWarn = false;
- if (!OldDecl->isUsed() && OldDecl->getDeclContext()->isFileContext()) {
+ if (!OldDecl->isUsed() && !OldDecl->isCXXClassMember()) {
auto *VD = dyn_cast<VarDecl>(OldDecl);
if (VD && !VD->getDescribedVarTemplate())
JustWarn = true;
Propchange: cfe/branches/release_35/test/Analysis/MismatchedDeallocator-checker-test.mm
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 4 03:47:45 2014
@@ -1,4 +1,4 @@
/cfe/branches/type-system-rewrite/test/Analysis/alloc-match-dealloc.mm:134693-134817
-/cfe/trunk/test/Analysis/MismatchedDeallocator-checker-test.mm:214777,216619
+/cfe/trunk/test/Analysis/MismatchedDeallocator-checker-test.mm:214777,216619,220874
/cfe/trunk/test/SemaTemplate/test/Analysis/alloc-match-dealloc.mm:126920
/cfe/trunk/test/test/Analysis/alloc-match-dealloc.mm:170344
Propchange: cfe/branches/release_35/test/Analysis/NewDelete-checker-test.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 4 03:47:45 2014
@@ -1,4 +1,4 @@
/cfe/branches/type-system-rewrite/test/Analysis/NewDelete-checker-test.mm:134693-134817
-/cfe/trunk/test/Analysis/NewDelete-checker-test.cpp:214777,216619
+/cfe/trunk/test/Analysis/NewDelete-checker-test.cpp:214777,216619,220874
/cfe/trunk/test/SemaTemplate/test/Analysis/NewDelete-checker-test.mm:126920
/cfe/trunk/test/test/Analysis/NewDelete-checker-test.mm:170344
Modified: cfe/branches/release_35/test/SemaCXX/dllexport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_35/test/SemaCXX/dllexport.cpp?rev=221253&r1=221252&r2=221253&view=diff
==============================================================================
--- cfe/branches/release_35/test/SemaCXX/dllexport.cpp (original)
+++ cfe/branches/release_35/test/SemaCXX/dllexport.cpp Tue Nov 4 03:47:45 2014
@@ -55,6 +55,11 @@ __declspec(dllexport) extern int GlobalR
extern int GlobalRedecl3; // expected-note{{previous declaration is here}}
__declspec(dllexport) extern int GlobalRedecl3; // expected-warning{{redeclaration of 'GlobalRedecl3' should not add 'dllexport' attribute}}
+extern "C" {
+ extern int GlobalRedecl4; // expected-note{{previous declaration is here}}
+__declspec(dllexport) extern int GlobalRedecl4; // expected-warning{{redeclaration of 'GlobalRedecl4' should not add 'dllexport' attribute}}
+}
+
// External linkage is required.
__declspec(dllexport) static int StaticGlobal; // expected-error{{'StaticGlobal' must have external linkage when declared 'dllexport'}}
__declspec(dllexport) Internal InternalTypeGlobal; // expected-error{{'InternalTypeGlobal' must have external linkage when declared 'dllexport'}}
@@ -188,8 +193,13 @@ __declspec(dllexport) void redecl2();
void redecl3(); // expected-note{{previous declaration is here}}
__declspec(dllexport) void redecl3(); // expected-warning{{redeclaration of 'redecl3' should not add 'dllexport' attribute}}
+extern "C" {
void redecl4(); // expected-note{{previous declaration is here}}
-__declspec(dllexport) inline void redecl4() {} // expected-warning{{redeclaration of 'redecl4' should not add 'dllexport' attribute}}
+__declspec(dllexport) void redecl4(); // expected-warning{{redeclaration of 'redecl4' should not add 'dllexport' attribute}}
+}
+
+ void redecl5(); // expected-note{{previous declaration is here}}
+__declspec(dllexport) inline void redecl5() {} // expected-warning{{redeclaration of 'redecl5' should not add 'dllexport' attribute}}
// Friend functions
struct FuncFriend {
Modified: cfe/branches/release_35/test/SemaCXX/dllimport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_35/test/SemaCXX/dllimport.cpp?rev=221253&r1=221252&r2=221253&view=diff
==============================================================================
--- cfe/branches/release_35/test/SemaCXX/dllimport.cpp (original)
+++ cfe/branches/release_35/test/SemaCXX/dllimport.cpp Tue Nov 4 03:47:45 2014
@@ -77,6 +77,11 @@ __declspec(dllimport) extern int GlobalR
extern int GlobalRedecl4; // expected-note{{previous declaration is here}}
__declspec(dllimport) extern int GlobalRedecl4; // expected-warning{{redeclaration of 'GlobalRedecl4' should not add 'dllimport' attribute}}
+extern "C" {
+ extern int GlobalRedecl5; // expected-note{{previous declaration is here}}
+__declspec(dllimport) extern int GlobalRedecl5; // expected-warning{{redeclaration of 'GlobalRedecl5' should not add 'dllimport' attribute}}
+}
+
// External linkage is required.
__declspec(dllimport) static int StaticGlobal; // expected-error{{'StaticGlobal' must have external linkage when declared 'dllimport'}}
__declspec(dllimport) Internal InternalTypeGlobal; // expected-error{{'InternalTypeGlobal' must have external linkage when declared 'dllimport'}}
@@ -226,8 +231,13 @@ __declspec(dllimport) void redecl3(); //
void redecl4(); // expected-note{{previous declaration is here}}
__declspec(dllimport) void redecl4(); // expected-warning{{redeclaration of 'redecl4' should not add 'dllimport' attribute}}
+extern "C" {
void redecl5(); // expected-note{{previous declaration is here}}
-__declspec(dllimport) inline void redecl5() {} // expected-warning{{redeclaration of 'redecl5' should not add 'dllimport' attribute}}
+__declspec(dllimport) void redecl5(); // expected-warning{{redeclaration of 'redecl5' should not add 'dllimport' attribute}}
+}
+
+ void redecl6(); // expected-note{{previous declaration is here}}
+__declspec(dllimport) inline void redecl6() {} // expected-warning{{redeclaration of 'redecl6' should not add 'dllimport' attribute}}
// Friend functions
struct FuncFriend {
Propchange: cfe/branches/release_35/test/SemaCXX/warn-unreachable.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 4 03:47:45 2014
@@ -1,2 +1,2 @@
/cfe/branches/type-system-rewrite/test/SemaCXX/warn-unreachable.cpp:134693-134817
-/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,214777,216619
+/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,214777,216619,220874
More information about the llvm-branch-commits
mailing list