diff --git a/simplecpp.cpp b/simplecpp.cpp index 90b22005..59f7b14d 100755 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -2526,6 +2526,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;