| 27 | } |
| 28 | |
| 29 | bool TopDUContext::DeclarationChecker::operator()(const Declaration* decl) const |
| 30 | { |
| 31 | if (!decl) |
| 32 | return false; |
| 33 | |
| 34 | if (top != decl->topContext()) { |
| 35 | if (( flags& DUContext::OnlyFunctions ) && !dynamic_cast<const AbstractFunctionDeclaration*>(decl)) |
| 36 | return false; |
| 37 | |
| 38 | if (dataType && decl->abstractType()->indexed() != dataType->indexed()) |
| 39 | // The declaration doesn't match the type filter we are applying |
| 40 | return false; |
| 41 | } else { |
| 42 | if (( flags& DUContext::OnlyFunctions ) && !dynamic_cast<const AbstractFunctionDeclaration*>(decl)) |
| 43 | return false; |
| 44 | |
| 45 | if (dataType && decl->abstractType() != dataType) |
| 46 | // The declaration doesn't match the type filter we are applying |
| 47 | return false; |
| 48 | |
| 49 | if (decl->range().start >= position) |
| 50 | if (!decl->context() || decl->context()->type() != DUContext::Class) |
| 51 | return false; // The declaration is behind the position we're searching from, therefore not accessible |
| 52 | } |
| 53 | // Success, this declaration is accessible |
| 54 | return true; |
| 55 | } |
nothing calls this directly
no test coverage detected