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

Sanjoy Das via llvm-dev
Sun, 04 Sep 2016 22:53:11 -0000

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