Fix crash in InfinteLoopCheck
authorNathan James <n.james93@hotmail.co.uk>
Thu, 13 Feb 2020 20:20:37 +0000 (20:20 +0000)
committerNathan James <n.james93@hotmail.co.uk>
Thu, 13 Feb 2020 20:20:37 +0000 (20:20 +0000)
clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp

index 0079300..c9dd47e 100644 (file)
@@ -153,6 +153,8 @@ static std::string getCondVarNames(const Stmt *Cond) {
 }
 
 static bool isKnownFalse(const Expr &Cond, const ASTContext &Ctx) {
+  if (Cond.isValueDependent())
+    return false;
   bool Result = false;
   if (Cond.EvaluateAsBooleanCondition(Result, Ctx))
     return !Result;