Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1031,8 +1031,7 @@ static bool isAlternativeAndBitandBitor(const simplecpp::Token* tok)

void simplecpp::TokenList::combineOperators()
{
std::stack<bool> executableScope;
executableScope.push(false);
std::stack<bool, std::vector<bool>> executableScope{{false}};

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.

isn't std::vector<bool> bad to use overall in c++11..
are you sure that all usage here will work fine..

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.

As this is about performance and valgrind indicates that is fine in either compiler so I see no problem.

libc++ has been adding special handling for vector<bool> and we are also not using it as a bit field here (which is the common usage for that IIRC).

for (Token *tok = front(); tok; tok = tok->next) {
if (tok->op == '{') {
if (executableScope.top()) {
Expand Down
Loading