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 Sep 11, 2023
1 parent 5051159 commit a5216b2
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 @@ -2540,6 +2540,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 a5216b2

Please sign in to comment.