[PATCH] D63082: [Diagnostics] Added support for -Wint-in-bool-context

Arnaud Bienner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 19 15:06:47 PDT 2019


ArnaudBienner added inline comments.


================
Comment at: lib/Sema/SemaChecking.cpp:11103
+
+  if (auto *BO = dyn_cast<BinaryOperator>(E)) {
+    BinaryOperator::Opcode Opc = BO->getOpcode();
----------------
Shouldn't that be "const auto*" instead?
I'm surprised dyn_cast casts away const qualifier, but FWIW having the returned pointer being const makes clearer the variable pointed by this pointer won't be modified.
But maybe this was intended to not make the code too verbose?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63082/new/

https://reviews.llvm.org/D63082





More information about the cfe-commits mailing list