Skip to content

Commit

Permalink
only perform __has_include simplification if code is C++17 or later
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Jan 3, 2023
1 parent 915d192 commit 87dd60e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2416,6 +2416,9 @@ static bool isCpp17OrLater(const simplecpp::DUI &dui)
static std::string openHeader(std::ifstream &f, const simplecpp::DUI &dui, const std::string &sourcefile, const std::string &header, bool systemheader);
static void simplifyHasInclude(simplecpp::TokenList &expr, const simplecpp::DUI &dui)
{
if (!isCpp17OrLater(dui))
return;

for (simplecpp::Token *tok = expr.front(); tok; tok = tok->next) {
if (tok->str() != HAS_INCLUDE)
continue;
Expand Down

0 comments on commit 87dd60e

Please sign in to comment.