[PATCH] D83362: Fix warning caused by __builtin_expect_with_probability was not handled in places such as constant folding

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 8 06:10:39 PDT 2020


erichkeane added inline comments.


================
Comment at: clang/test/Sema/builtin-expect-with-probability.cpp:12
+  }
+}  // should not emit warn "control may reach end of non-void function" here since expr is constantly true, so the "if(__bui..)" should be constantly true condition and be ignored
+
----------------
Please also validate this by doing some sort of test in a constexpr function if possible. That way you can make sure the parameter is evaluated.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83362





More information about the cfe-commits mailing list