AST: Do not generate AST for decltype
This commit is contained in:
parent
65e0694fc6
commit
7878eb2512
|
@ -1390,6 +1390,8 @@ static Token * findAstTop(Token *tok1, Token *tok2)
|
||||||
|
|
||||||
static Token * createAstAtToken(Token *tok, bool cpp)
|
static Token * createAstAtToken(Token *tok, bool cpp)
|
||||||
{
|
{
|
||||||
|
if (cpp && Token::simpleMatch(tok, "decltype ("))
|
||||||
|
return tok->linkAt(1);
|
||||||
if (Token::simpleMatch(tok, "for (")) {
|
if (Token::simpleMatch(tok, "for (")) {
|
||||||
if (cpp && Token::Match(tok, "for ( const| auto &|&&| [")) {
|
if (cpp && Token::Match(tok, "for ( const| auto &|&&| [")) {
|
||||||
Token *decl = Token::findsimplematch(tok, "[");
|
Token *decl = Token::findsimplematch(tok, "[");
|
||||||
|
|
|
@ -7887,6 +7887,7 @@ private:
|
||||||
ASSERT_EQUALS("unoRef:: var0(", testAst(code1));
|
ASSERT_EQUALS("unoRef:: var0(", testAst(code1));
|
||||||
|
|
||||||
ASSERT_EQUALS("vary=", testAst("std::string var = y;"));
|
ASSERT_EQUALS("vary=", testAst("std::string var = y;"));
|
||||||
|
ASSERT_EQUALS("var1=", testAst("decltype(x) var = 1;"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void astunaryop() { // unary operators
|
void astunaryop() { // unary operators
|
||||||
|
|
Loading…
Reference in New Issue