Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ static const std::unordered_set<std::string> stdTypes = { "bool"
, "int"
, "long"
, "short"
, "size_t"
, "void"
, "wchar_t"
, "signed"
Expand Down
7 changes: 0 additions & 7 deletions test/testtoken.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,6 @@ class TestToken : public TestFixture {
standard_types.emplace_back("long");
standard_types.emplace_back("float");
standard_types.emplace_back("double");
standard_types.emplace_back("size_t");

for (auto test_op = standard_types.cbegin(); test_op != standard_types.cend(); ++test_op) {
auto tokensFrontBack = std::make_shared<TokensFrontBack>();
Expand Down Expand Up @@ -1488,8 +1487,6 @@ class TestToken : public TestFixture {
TokenList list_c{settingsDefault, Standards::Language::C};
auto tokensFrontBack = std::make_shared<TokensFrontBack>();
Token tok(list_c, std::move(tokensFrontBack));
tok.str("size_t"); // not treated as keyword in TokenList::isKeyword()
Comment thread
chrchr-github marked this conversation as resolved.
assert_tok(&tok, Token::Type::eType, /*l=*/ false, /*std=*/ true);
}
}

Expand All @@ -1506,17 +1503,13 @@ class TestToken : public TestFixture {
TokenList list_cpp{settingsDefault, Standards::Language::CPP};
auto tokensFrontBack = std::make_shared<TokensFrontBack>();
Token tok(list_cpp, std::move(tokensFrontBack));
tok.str("size_t");
assert_tok(&tok, Token::Type::eType, /*l=*/ false, /*std=*/ true);
}
}

void update_property_info_replace() const // #13743
{
auto tokensFrontBack = std::make_shared<TokensFrontBack>();
Token tok(list, std::move(tokensFrontBack));
tok.str("size_t");
assert_tok(&tok, Token::Type::eType, false, true);
tok.str("long");
assert_tok(&tok, Token::Type::eType, false, true);
}
Expand Down
2 changes: 2 additions & 0 deletions test/testtokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7845,6 +7845,8 @@ class TestTokenizer : public TestFixture {
"}\n"));

ignore_errout();

ASSERT_EQUALS(";", tokenizeAndStringify("typedef std::size_t size_t;\n")); // #14809
}


Expand Down
2 changes: 1 addition & 1 deletion test/testvarid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2840,7 +2840,7 @@ class TestVarID : public TestFixture {
void varid_using() {
// #3648
const char code[] = "using std::size_t;";
const char expected[] = "1: using unsigned long ;\n";
const char expected[] = "1: ;\n";
ASSERT_EQUALS(expected, tokenize(code));
}

Expand Down
Loading