Fixed #6629: Don't simplify sinf(0) if sinf is a variable
This commit is contained in:
parent
708a379fd2
commit
c4ceb97cea
|
@ -8372,7 +8372,7 @@ bool Tokenizer::isTwoNumber(const std::string &s)
|
|||
void Tokenizer::simplifyMathFunctions()
|
||||
{
|
||||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||
if (tok->isName() && tok->strAt(1) == "(") { // precondition for function
|
||||
if (tok->isName() && !tok->varId() && tok->strAt(1) == "(") { // precondition for function
|
||||
bool simplifcationMade = false;
|
||||
if (Token::Match(tok, "atol ( %str% )")) { //@todo Add support for atoll()
|
||||
if (tok->previous() &&
|
||||
|
|
|
@ -7557,6 +7557,11 @@ private:
|
|||
"std :: cout << 0 ;\n"
|
||||
"}";
|
||||
ASSERT_EQUALS(expected_sinl, tokenizeAndStringify(code_sinl));
|
||||
|
||||
// #6629
|
||||
const char code[] = "class Foo { int sinf; Foo() : sinf(0) {} };";
|
||||
const char expected[] = "class Foo { int sinf ; Foo ( ) : sinf ( 0 ) { } } ;";
|
||||
ASSERT_EQUALS(expected, tokenizeAndStringify(code));
|
||||
}
|
||||
|
||||
void simplifyMathFunctions_ilogb() {
|
||||
|
|
Loading…
Reference in New Issue