From 6b6136bc22598e25321bc0a9c65688726b52af68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Mon, 1 Jun 2026 10:49:17 +0200 Subject: [PATCH 1/2] add test --- test/testsymboldatabase.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index e981c8ea546..dcb27a39e01 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -10164,6 +10164,15 @@ class TestSymbolDatabase : public TestFixture { ASSERT(tok); TODO_ASSERT(tok->valueType() && "container(std :: string|wstring|u16string|u32string)" == tok->valueType()->str()); } + { + GET_SYMBOL_DB("void f() {\n" + " int &&x = 0;\n" + "}\n"); + + const Token* tok = Token::findsimplematch(tokenizer.tokens(), "&&"); + ASSERT(tok); + ASSERT_EQUALS(static_cast(nullptr), tok->valueType()); + } } void valueTypeThis() { From ab0f90116b565db2fa2fb69752b568acab240ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Mon, 1 Jun 2026 10:36:30 +0200 Subject: [PATCH 2/2] fix --- lib/symboldatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index dda3e9b1e0b..1693dbb3037 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -7819,7 +7819,7 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to setValueType(tok, ValueType(sign, type, 0U)); } - } else if (tok->isComparisonOp() || tok->tokType() == Token::eLogicalOp) { + } else if ((tok->isComparisonOp() || tok->tokType() == Token::eLogicalOp) && tok->astOperand1()) { if (tok->isCpp() && tok->isComparisonOp() && (getClassScope(tok->astOperand1()) || getClassScope(tok->astOperand2()))) { const Function *function = getOperatorFunction(tok); if (function) {