diff options
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r-- | lib/AST/DeclBase.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index b04c149dee..7b20e7751a 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -261,6 +261,13 @@ bool Decl::isUsed(bool CheckUsedAttr) const { if (CheckUsedAttr && hasAttr<UsedAttr>()) return true; + // Check redeclarations. We merge attributes, so we don't need to check + // attributes in all redeclarations. + for (redecl_iterator I = redecls_begin(), E = redecls_end(); I != E; ++I) { + if (I->Used) + return true; + } + return false; } |