From 21b0dc4039ef15165e5a23be81329fba6ff9980e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Wed, 10 Sep 2025 11:02:35 +0200 Subject: [PATCH 1/2] update test --- test/cli/other_test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/cli/other_test.py b/test/cli/other_test.py index a747493e48d..fa96bbd64b3 100644 --- a/test/cli/other_test.py +++ b/test/cli/other_test.py @@ -3164,6 +3164,15 @@ def test_check_unused_templates_func(tmp_path): # #13714 (void)(*((int*)0)); } +class S { +public: + template + void f_t_3() + { + (void)(*((int*)0)); + } +}; + void f() {} """) From b39fe77073516719a02d9f2dd1524bc3a417c8d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Mon, 8 Sep 2025 11:24:10 +0200 Subject: [PATCH 2/2] fix #14118 --- lib/tokenize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 166662622a3..0db807333c0 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -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) {