AST: better handling of 'sizeof(void*)'
This commit is contained in:
parent
a15561d7eb
commit
5d5e347418
|
@ -531,6 +531,8 @@ static void compileMulDiv(Token *&tok, std::stack<Token*> &op)
|
||||||
compileDot(tok,op);
|
compileDot(tok,op);
|
||||||
while (tok) {
|
while (tok) {
|
||||||
if (Token::Match(tok, "[*/%]")) {
|
if (Token::Match(tok, "[*/%]")) {
|
||||||
|
if (Token::Match(tok, "* [,)]"))
|
||||||
|
break;
|
||||||
compileBinOp(tok, compileDot, op);
|
compileBinOp(tok, compileDot, op);
|
||||||
} else break;
|
} else break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10065,6 +10065,7 @@ private:
|
||||||
testAst("extern void f(const char *format, ...);"); // don't crash
|
testAst("extern void f(const char *format, ...);"); // don't crash
|
||||||
testAst("extern int for_each_commit_graft(int (*)(int*), void *);"); // don't crash
|
testAst("extern int for_each_commit_graft(int (*)(int*), void *);"); // don't crash
|
||||||
testAst("for (;;) {}"); // don't crash
|
testAst("for (;;) {}"); // don't crash
|
||||||
|
ASSERT_EQUALS("xsizeofvoid(=", testAst("x=sizeof(void*)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void asttemplate() const { // uninstantiated templates will have <,>,etc..
|
void asttemplate() const { // uninstantiated templates will have <,>,etc..
|
||||||
|
|
Loading…
Reference in New Issue