Skip to content

Commit 3606218

Browse files
committed
Revert "Warn on RequiresCapability attribute mismatches between declarations"
This reverts commit 804ed36.
1 parent e58aa08 commit 3606218

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4031,9 +4031,6 @@ def warn_acquired_before : Warning<
40314031
def warn_acquired_before_after_cycle : Warning<
40324032
"cycle in acquired_before/after dependencies, starting with '%0'">,
40334033
InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
4034-
def warn_attribute_mismatch : Warning<
4035-
"attribute mismatch between function declarations of %0">,
4036-
InGroup<ThreadSafetyAttributes>, DefaultIgnore;
40374034

40384035

40394036
// Thread safety warnings negative capabilities

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5842,30 +5842,6 @@ static void handleRequiresCapabilityAttr(Sema &S, Decl *D,
58425842
RequiresCapabilityAttr(S.Context, AL, Args.data(), Args.size());
58435843

58445844
D->addAttr(RCA);
5845-
5846-
if (const auto *FD = dyn_cast<FunctionDecl>(D)) {
5847-
5848-
auto collectExprs = [](const FunctionDecl *FuncDecl) {
5849-
std::set<const ValueDecl*> Args;
5850-
for (const auto *A : FuncDecl->specific_attrs<RequiresCapabilityAttr>()) {
5851-
for (const Expr *E : A->args()) {
5852-
if (const auto *DRE = dyn_cast<DeclRefExpr>(E))
5853-
Args.insert(DRE->getDecl());
5854-
}
5855-
}
5856-
return Args;
5857-
};
5858-
auto ThisDecl = collectExprs(FD);
5859-
for (const FunctionDecl *P = FD->getPreviousDecl(); P;
5860-
P = P->getPreviousDecl()) {
5861-
auto PrevDecl = collectExprs(P);
5862-
// FIXME: It would be nice to mention _what_ attribute isn't matched and maybe
5863-
// even where the previous declaration was?
5864-
if (ThisDecl.size() != PrevDecl.size())
5865-
S.Diag(D->getLocation(), diag::warn_attribute_mismatch) << FD;
5866-
}
5867-
5868-
}
58695845
}
58705846

58715847
static void handleDeprecatedAttr(Sema &S, Decl *D, const ParsedAttr &AL) {

0 commit comments

Comments
 (0)