Skip to content

Fix #688: Support #elifdef and #elifndef#691

Open
ludviggunne wants to merge 2 commits into
cppcheck-opensource:masterfrom
ludviggunne:688-ifdef
Open

Fix #688: Support #elifdef and #elifndef#691
ludviggunne wants to merge 2 commits into
cppcheck-opensource:masterfrom
ludviggunne:688-ifdef

Conversation

@ludviggunne

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread simplecpp.cpp
}
} else if (rawtok->str() == IF || rawtok->str() == IFDEF || rawtok->str() == IFNDEF || rawtok->str() == ELIF) {
} else if (rawtok->str() == IF || rawtok->str() == IFDEF || rawtok->str() == IFNDEF || rawtok->str() == ELIF ||
((getCStd(dui.std) >= C23 || getCppStd(dui.std) >= CPP23) && (rawtok->str() == ELIFDEF || rawtok->str() == ELIFNDEF))) {

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.

I feel that we don't need to check the standard. If we see #elifdef we can use the same handling used in C23/C++23.. Let's check the standard if some different behaviors are wanted.

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