[PATCH] D60547: Add checks for MSVC in LLVM_FALLTHROUGH and LLVM_NODISCARD

Thad House via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 11 12:06:26 PDT 2019


ThadHouse marked an inline comment as done.
ThadHouse added inline comments.


================
Comment at: llvm/include/llvm/Support/Compiler.h:123
 /// LLVM_NODISCARD - Warn if a type or return value is discarded.
 #if __cplusplus > 201402L && __has_cpp_attribute(nodiscard)
 #define LLVM_NODISCARD [[nodiscard]]
----------------
zturner wrote:
> zturner wrote:
> > What about just changing this `&&` to an `||`?
> Another question: Why is the check for `__cplusplus` even needed?
Is there CI for testing against old versions of clang and GCC, to make sure that it doesn't cause a regression. Otherwise yeah I think that would work too. Although I wonder if the original creators had a reason to check a newer c++ version.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D60547





More information about the llvm-commits mailing list