From 826ebd972e8a89400502aa771085babbb07ef437 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 13 Jul 2026 11:20:08 +0200 Subject: [PATCH 1/3] Update templatesimplifier.cpp --- lib/templatesimplifier.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index 6fdd423628b..24cc0bcbe1d 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -496,7 +496,7 @@ unsigned int TemplateSimplifier::templateParameters(const Token *tok) return 0; // num/type .. - if (!tok->isNumber() && tok->tokType() != Token::eChar && tok->tokType() != Token::eString && !tok->isName() && !tok->isOp()) + if (!tok->isNumber() && tok->tokType() != Token::eChar && tok->tokType() != Token::eString && !tok->isName() && !tok->isOp() && tok->str() != ".") return 0; tok = tok->next(); if (!tok) From a4375ef92c8fe1fac07000475143de117351b6e0 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 13 Jul 2026 11:21:02 +0200 Subject: [PATCH 2/3] Update testtokenize.cpp --- test/testtokenize.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index c4de2be00e7..8f789d74161 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -2387,6 +2387,19 @@ class TestTokenizer : public TestFixture { ASSERT_EQUALS(expected, tokenizeAndStringify(code)); } + void vardecl_template_3() { + const char code[] = "template \n" // #14909 + "void f(T x) {\n" + " const auto y = h;\n" + "}"; + const char expected[] = "template < class T >\n" + "void f ( T x ) {\n" + "const auto y = h < T , x . size ( ) > ;\n" + "}"; + ASSERT_EQUALS(expected, tokenizeAndStringify(code)); + ASSERT_EQUALS("[test.cpp:3:11]: (debug) auto token with no type. [autoNoType]\n", errout_str()); + } + void vardecl_union() { // ticket #1976 const char code1[] = "class Fred { public: union { int a ; int b ; } ; } ;"; From 35a63294b4998f76f1b2ae58b4c71b90e9681133 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 13 Jul 2026 12:24:51 +0200 Subject: [PATCH 3/3] Update testtokenize.cpp --- test/testtokenize.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 8f789d74161..a6741a99243 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -240,6 +240,7 @@ class TestTokenizer : public TestFixture { TEST_CASE(vardecl_stl_3); TEST_CASE(vardecl_template_1); TEST_CASE(vardecl_template_2); + TEST_CASE(vardecl_template_3); TEST_CASE(vardecl_union); TEST_CASE(vardecl_par); // #2743 - set links if variable type contains parentheses TEST_CASE(vardecl_par2); // #3912 - set correct links