clang 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
clang::ConversionFixItGenerator Struct Reference

The class facilities generation and storage of conversion FixIts. More...

#include "clang/Sema/SemaFixItUtils.h"

Public Types

typedef bool(* TypeComparisonFuncTy) (const CanQualType FromTy, const CanQualType ToTy, Sema &S, SourceLocation Loc, ExprValueKind FromVK)
 

Public Member Functions

 ConversionFixItGenerator (TypeComparisonFuncTy Foo)
 
 ConversionFixItGenerator ()
 
void setConversionChecker (TypeComparisonFuncTy Foo)
 Resets the default conversion checker method.
 
bool tryToFixConversion (const Expr *FromExpr, const QualType FromQTy, const QualType ToQTy, Sema &S)
 If possible, generates and stores a fix for the given conversion.
 
void clear ()
 
bool isNull ()
 

Static Public Member Functions

static bool compareTypesSimple (CanQualType From, CanQualType To, Sema &S, SourceLocation Loc, ExprValueKind FromVK)
 Performs a simple check to see if From type can be converted to To type.
 

Public Attributes

std::vector< FixItHintHints
 The list of Hints generated so far.
 
unsigned NumConversionsFixed
 The number of Conversions fixed.
 
OverloadFixItKind Kind
 The type of fix applied.
 
TypeComparisonFuncTy CompareTypes
 The type comparison function used to decide if expression FromExpr of type FromTy can be converted to ToTy.
 

Detailed Description

The class facilities generation and storage of conversion FixIts.

Hints for new conversions are added using TryToFixConversion method. The default type conversion checker can be reset.

Definition at line 32 of file SemaFixItUtils.h.

Member Typedef Documentation

◆ TypeComparisonFuncTy

typedef bool(* clang::ConversionFixItGenerator::TypeComparisonFuncTy) (const CanQualType FromTy, const CanQualType ToTy, Sema &S, SourceLocation Loc, ExprValueKind FromVK)

Definition at line 51 of file SemaFixItUtils.h.

Constructor & Destructor Documentation

◆ ConversionFixItGenerator() [1/2]

clang::ConversionFixItGenerator::ConversionFixItGenerator ( TypeComparisonFuncTy  Foo)
inline

Definition at line 61 of file SemaFixItUtils.h.

◆ ConversionFixItGenerator() [2/2]

clang::ConversionFixItGenerator::ConversionFixItGenerator ( )
inline

Definition at line 65 of file SemaFixItUtils.h.

Member Function Documentation

◆ clear()

void clang::ConversionFixItGenerator::clear ( )
inline

Definition at line 79 of file SemaFixItUtils.h.

References Hints, and NumConversionsFixed.

Referenced by clang::OverloadCandidate::TryToFixBadConversion().

◆ compareTypesSimple()

bool ConversionFixItGenerator::compareTypesSimple ( CanQualType  From,
CanQualType  To,
Sema S,
SourceLocation  Loc,
ExprValueKind  FromVK 
)
static

Performs a simple check to see if From type can be converted to To type.

Definition at line 22 of file