Skip to content

Fix #14744: Invalid AST for braced init and references/pointers#8549

Open
ludviggunne wants to merge 3 commits intocppcheck-opensource:mainfrom
ludviggunne:14744
Open

Fix #14744: Invalid AST for braced init and references/pointers#8549
ludviggunne wants to merge 3 commits intocppcheck-opensource:mainfrom
ludviggunne:14744

Conversation

@ludviggunne
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread test/testtokenize.cpp
}

void astbracedinit() {
ASSERT_EQUALS("intab{&", testAst("int &a { b };"));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests seem to reflect the status quo, i.e. the AST still contains &, &&, and *.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm weird... it looks good with --debug --verbose so I just copy-pasted from these. Are there parts of the AST that are not printed with those flags?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test code is not tokenized like regular code, especially varids are not set. Maybe ListSimplification::Full would help.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, there is a cyclic AST exception with ListSimplification::Full, so this needs additional work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants