[llvm-dev] Adding [[nodiscard]] to Compiler.h

Sanjoy Das via llvm-dev llvm-dev at lists.llvm.org
Sun Sep 4 15:53:11 PDT 2016


Hi Chandler,

Chandler Carruth wrote:
 > My 2 cents: get rid of LLVM_UNUSED_RESULT, and move to LLVM_NODISCARD.
 >
 > For compilers that support it, it should be a strict superset of features and functionality. The standard feature was
 > written directly based on the clang warn_unused_result stuff.

Maybe I misunderstood something, but with clang 3.8.1 I cannot write:

int [[clang::nodiscard]] f();

so I'm not sure if LLVM_NODISCARD provides a superset of the functionality.

-- Sanjoy


More information about the llvm-dev mailing list