From 8b2adf1391f5ae02040ecf1fdc6c2d422e87c343 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Tue, 8 Jan 2013 20:26:48 +0100 Subject: [PATCH] Change location of %op% operator in multicompare When the %op% operator is the first element of a multicompare, it properly executes Token::isOp(). Otherwise it uses it's "internal implementation". Workaround inspired by Edoardo Prezioso. --- lib/templatesimplifier.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index b1d7b4f03..ff8dc47a1 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -793,7 +793,7 @@ bool TemplateSimplifier::simplifyCalculations(Token *_tokens) // keep parentheses here: operator new [] (size_t); // keep parentheses here: Functor()(a ... ) // keep parentheses here: ) ( var ) ; - if (Token::Match(tok->next(), "( %var% ) ;|)|,|]|%op%") && + if (Token::Match(tok->next(), "( %var% ) %op%|;|)|,|]") && !tok->isName() && tok->str() != ">" && tok->str() != "]" &&