[clang-format] assert(false) -> llvm_unreachable
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 15 Feb 2023 13:10:09 +0000 (14:10 +0100)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 15 Feb 2023 13:10:09 +0000 (14:10 +0100)
Avoids warnings in -asserts builds.

FormatTokenSource.h:240:3: error: non-void function does not return a value [-Werror,-Wreturn-type]
  }
  ^

clang/lib/Format/FormatTokenSource.h

index 8bf7e69..0be4628 100644 (file)
@@ -236,7 +236,7 @@ public:
   }
 
   FormatToken *insertTokens(ArrayRef<FormatToken *> Tokens) override {
-    assert(false && "Cannot insert tokens while parsing a macro.");
+    llvm_unreachable("Cannot insert tokens while parsing a macro.");
   }
 
 private: