Support: Add LLVM_NODISCARD with C++17's [[nodiscard]] semantics
authorJustin Bogner <mail@justinbogner.com>
Fri, 14 Oct 2016 22:04:17 +0000 (22:04 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 14 Oct 2016 22:04:17 +0000 (22:04 +0000)
commitdd5b2afdf60344e053bfb43a4cbaf4ea55e02ae5
treeef1f2dbb6d8c7ab3ae8aca0a6fd18b28c36bf033
parentb715eb450445f86d0677be9b2b20912ebdf7f353
Support: Add LLVM_NODISCARD with C++17's [[nodiscard]] semantics

This is essentially a more powerful version of our current
LLVM_ATTRIBUTE_UNUSED_RESULT, in that it can also be applied to types
and generate warnings whenever an object of that type is returned by
value and the value is discarded.

I'll replace uses of LLVM_ATTRIBUTE_UNUSED_RESULT and remove that
macro in follow up commits.

llvm-svn: 284286
llvm/include/llvm/Support/Compiler.h