37 if (
const auto *VD = Result.Nodes.getNodeAs<VarDecl>(
"non-static-var")) {
38 if (
const auto *PD = dyn_cast<ParmVarDecl>(VD)) {
41 diag(PD->getTypeSpecStartLoc(),
42 "dispatch_once_t variables must have static or global storage "
43 "duration; function parameters should be pointer references");
45 diag(VD->getTypeSpecStartLoc(),
"dispatch_once_t variables must have "
46 "static or global storage duration")
47 << FixItHint::CreateInsertion(VD->getTypeSpecStartLoc(),
"static ");
51 if (
const auto *D = Result.Nodes.getNodeAs<ObjCIvarDecl>(
"ivar")) {
52 diag(D->getTypeSpecStartLoc(),
53 "dispatch_once_t variables must have static or global storage "
54 "duration and cannot be Objective-C instance variables");