@@ -1808,8 +1808,7 @@ void SymbolDatabase::setArrayDimensionsUsingValueFlow()
1808
1808
1809
1809
// In template arguments, there might not be AST
1810
1810
// Determine size by using the "raw tokens"
1811
- TokenList tokenList (&mSettings );
1812
- tokenList.setLang (dimension.tok ->isCpp () ? Standards::Language::CPP : Standards::Language::C);
1811
+ TokenList tokenList (&mSettings , dimension.tok ->isCpp () ? Standards::Language::CPP : Standards::Language::C);
1813
1812
tokenList.addtoken (" ;" , 0 , 0 , 0 , false );
1814
1813
bool fail = false ;
1815
1814
for (const Token *tok = dimension.tok ; tok && !Token::Match (tok, " [,>]" ); tok = tok->next ()) {
@@ -7293,7 +7292,7 @@ static const Token* parsedecl(const Token* type,
7293
7292
else if (Token::simpleMatch (type, " volatile" ))
7294
7293
valuetype->volatileness |= (1 << (valuetype->pointer - pointer0));
7295
7294
else if (settings.clang && type->str ().size () > 2 && type->str ().find (" ::" ) < type->str ().find (' <' )) {
7296
- TokenList typeTokens (&settings);
7295
+ TokenList typeTokens (&settings, type-> isCpp () ? Standards::Language::CPP : Standards::Language::C );
7297
7296
std::string::size_type pos1 = 0 ;
7298
7297
do {
7299
7298
const std::string::size_type pos2 = type->str ().find (" ::" , pos1);
@@ -7716,9 +7715,9 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
7716
7715
const std::string& typestr (mSettings .library .returnValueType (tok->previous ()));
7717
7716
if (!typestr.empty ()) {
7718
7717
ValueType valuetype;
7719
- TokenList tokenList (&mSettings );
7718
+ TokenList tokenList (&mSettings , tok-> isCpp () ? Standards::Language::CPP : Standards::Language::C );
7720
7719
std::istringstream istr (typestr+" ;" );
7721
- tokenList.createTokens (istr, tok-> isCpp () ? Standards::Language::CPP : Standards::Language::C ); // TODO: check result?
7720
+ tokenList.createTokens (istr); // TODO: check result?
7722
7721
tokenList.simplifyStdType ();
7723
7722
if (parsedecl (tokenList.front (), &valuetype, mDefaultSignedness , mSettings )) {
7724
7723
valuetype.originalTypeName = typestr;
@@ -7806,9 +7805,9 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
7806
7805
}
7807
7806
continue ;
7808
7807
}
7809
- TokenList tokenList (&mSettings );
7808
+ TokenList tokenList (&mSettings , tok-> isCpp () ? Standards::Language::CPP : Standards::Language::C );
7810
7809
std::istringstream istr (typestr+" ;" );
7811
- if (tokenList.createTokens (istr, tok-> isCpp () ? Standards::Language::CPP : Standards::Language::C )) {
7810
+ if (tokenList.createTokens (istr)) {
7812
7811
ValueType vt;
7813
7812
tokenList.simplifyPlatformTypes ();
7814
7813
tokenList.simplifyStdType ();
0 commit comments