class FunctionCallFilterCCC

Declaration

class FunctionCallFilterCCC : public CorrectionCandidateCallback { /* full declaration omitted */ };

Description

Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo correction.

Declared at: clang/include/clang/Sema/TypoCorrection.h:379

Inherits from: CorrectionCandidateCallback

Member Variables

private unsigned int NumArgs
private bool HasExplicitTemplateArgs
private clang::DeclContext* CurContext
private clang::MemberExpr* MemberFn

Inherited from CorrectionCandidateCallback:

public WantTypeSpecifiers = true
public WantExpressionKeywords = true
public WantCXXNamedCasts = true
public WantFunctionLikeCasts = true
public WantRemainingKeywords = true
public WantObjCSuper = false
public IsObjCIvarLookup = false
public IsAddressOfOperand = false
protected Typo
protected TypoNNS
public static InvalidDistance = TypoCorrection::InvalidDistance

Method Overview

  • public FunctionCallFilterCCC(clang::Sema & SemaRef, unsigned int NumArgs, bool HasExplicitTemplateArgs, clang::MemberExpr * ME = nullptr)
  • public bool ValidateCandidate(const clang::TypoCorrection & candidate)
  • public std::unique_ptr<CorrectionCandidateCallback> clone()

Inherited from CorrectionCandidateCallback:

Methods

FunctionCallFilterCCC(
    clang::Sema& SemaRef,
    unsigned int NumArgs,
    bool HasExplicitTemplateArgs,
    clang::MemberExpr* ME = nullptr)

Declared at: clang/include/clang/Sema/TypoCorrection.h:381

Parameters

clang::Sema& SemaRef
unsigned int NumArgs
bool HasExplicitTemplateArgs
clang::MemberExpr* ME = nullptr

bool ValidateCandidate(
    const clang::TypoCorrection& candidate)

Description

Simple predicate used by the default RankCandidate to determine whether to return an edit distance of 0 or InvalidDistance. This can be overridden by validators that only need to determine if a candidate is viable, without ranking potentially viable candidates. Only ValidateCandidate or RankCandidate need to be overridden by a callback wishing to check the viability of correction candidates. The default predicate always returns true if the candidate is not a type name or keyword, true for types if WantTypeSpecifiers is true, and true for keywords if WantTypeSpecifiers, WantExpressionKeywords, WantCXXNamedCasts, WantRemainingKeywords, or WantObjCSuper is true.

Declared at: clang/include/clang/Sema/TypoCorrection.h:385

Parameters

const clang::TypoCorrection& candidate

std::unique_ptr<CorrectionCandidateCallback>
clone()

Description

Clone this CorrectionCandidateCallback. CorrectionCandidateCallbacks are initially stack-allocated. However in case where delayed typo-correction is done we need to move the callback to storage with a longer lifetime. Every class deriving from CorrectionCandidateCallback must implement this method.

Declared at: clang/include/clang/Sema/TypoCorrection.h:386