@@ -796,41 +796,39 @@ static bool isTemplateInstantion(const Token* tok)
796796 return Token::Match (tok->tokAt (-2 ), " (|{|}|;|=|<<|:|.|*|&|return|<|,|!|[ :: %name% ::|<|(" );
797797}
798798
799- namespace {
800799// A function template parameter with a form that is supported by type deduction:
801800// "T", "T &", "const T &", "T *", "const T *" or a concrete single token type
802- struct ParameterShape {
803- const Token* typeTok = nullptr ;
804- int templateParameterIndex = -1 ; // -1 => a concrete type, nothing is deduced
805- bool isConst = false ;
806- bool isPointer = false ;
807- bool isReference = false ;
808- };
801+ struct ParameterShape {
802+ const Token* typeTok = nullptr ;
803+ int templateParameterIndex = -1 ; // -1 => a concrete type, nothing is deduced
804+ bool isConst = false ;
805+ bool isPointer = false ;
806+ bool isReference = false ;
807+ };
809808
810809// The type deduced for a template parameter from a function call argument
811- struct DeducedType {
812- std::string typeStr; // base type, e.g. "int" or "MyClass"
813- std::vector<std::string> qualification; // enclosing scopes for record types, outermost first
814- unsigned int constness = 0 ; // bit 0 = data const, bit 1 = first '*' const, ..
815- unsigned int pointer = 0 ; // number of '*'
816- bool isUnsigned = false ;
817- bool isLong = false ;
818-
819- bool operator ==(const DeducedType& other) const
820- {
821- return typeStr == other.typeStr && qualification == other.qualification && constness == other.constness &&
822- pointer == other.pointer && isUnsigned == other.isUnsigned && isLong == other.isLong ;
823- }
824- };
810+ struct DeducedType {
811+ std::string typeStr; // base type, e.g. "int" or "MyClass"
812+ std::vector<std::string> qualification; // enclosing scopes for record types, outermost first
813+ unsigned int constness = 0 ; // bit 0 = data const, bit 1 = first '*' const, ..
814+ unsigned int pointer = 0 ; // number of '*'
815+ bool isUnsigned = false ;
816+ bool isLong = false ;
817+
818+ bool operator ==(const DeducedType& other) const
819+ {
820+ return typeStr == other.typeStr && qualification == other.qualification && constness == other.constness &&
821+ pointer == other.pointer && isUnsigned == other.isUnsigned && isLong == other.isLong ;
822+ }
823+ };
825824
826825// A parsed function template declaration that type deduction supports. Invalid
827826// (typeParameters is empty) when the declaration is not supported.
828- struct DeductionCandidate {
829- std::vector<const Token*> typeParameters;
830- std::vector<ParameterShape> parameterShapes;
831- std::string signature;
832- };
833- } // namespace
827+ struct DeductionCandidate {
828+ std::vector<const Token*> typeParameters;
829+ std::vector<ParameterShape> parameterShapes;
830+ std::string signature;
831+ };
834832
835833// Parse a function parameter of a template declaration. The returned shape has no
836834// typeTok when the parameter does not have a supported form.
0 commit comments