Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6363,7 +6363,7 @@ void Tokenizer::simplifyHeadersAndUnusedTemplates()
}
}

if (!tok->previous() || Token::Match(tok->previous(), "[;{}]")) {
if (!tok->previous() || Token::Match(tok->previous(), "[;{}:]")) {
// Remove unused function declarations
if (isIncluded && removeUnusedIncludedFunctions) {
while (true) {
Expand Down
9 changes: 9 additions & 0 deletions test/cli/other_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3164,6 +3164,15 @@ def test_check_unused_templates_func(tmp_path): # #13714
(void)(*((int*)0));
}

class S {
public:
template<typename T>
void f_t_3()
{
(void)(*((int*)0));
}
};

void f() {}
""")

Expand Down