diff options
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/DeclBase.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 4400d503f26..870b8f11d78 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -261,9 +261,10 @@ bool Decl::isUsed(bool CheckUsedAttr) const { if (CheckUsedAttr && hasAttr<UsedAttr>()) return true; - // Check redeclarations for used attribute. + // 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 ((CheckUsedAttr && I->hasAttr<UsedAttr>()) || I->Used) + if (I->Used) return true; } |

