Skip to content

Commit f591566

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

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
@@ -5794,30 +5794,6 @@ static void handleRequiresCapabilityAttr(Sema &S, Decl *D,
57945794
RequiresCapabilityAttr(S.Context, AL, Args.data(), Args.size());
57955795

57965796
D->addAttr(RCA);
5797-
5798-
if (const auto *FD = dyn_cast<FunctionDecl>(D)) {
5799-
5800-
auto collectExprs = [](const FunctionDecl *FuncDecl) {
5801-
std::set<const ValueDecl*> Args;
5802-
for (const auto *A : FuncDecl->specific_attrs<RequiresCapabilityAttr>()) {
5803-
for (const Expr *E : A->args()) {
5804-
if (const auto *DRE = dyn_cast<DeclRefExpr>(E))
5805-
Args.insert(DRE->getDecl());
5806-
}
5807-
}
5808-
return Args;
5809-
};
5810-
auto ThisDecl = collectExprs(FD);
5811-
for (const FunctionDecl *P = FD->getPreviousDecl(); P;
5812-
P = P->getPreviousDecl()) {
5813-
auto PrevDecl = collectExprs(P);
5814-
// FIXME: It would be nice to mention _what_ attribute isn't matched and maybe
5815-
// even where the previous declaration was?
5816-
if (ThisDecl.size() != PrevDecl.size())
5817-
S.Diag(D->getLocation(), diag::warn_attribute_mismatch) << FD;
5818-
}
5819-
5820-
}
58215797
}
58225798

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

0 commit comments

Comments
 (0)