Add FOLLY_NODISCARD for [[nodiscard]] attribute when it exists, FOLLY_WARN_UNUSED_RES...
authorEric Niebler <eniebler@fb.com>
Tue, 23 May 2017 16:01:31 +0000 (09:01 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 23 May 2017 16:07:14 +0000 (09:07 -0700)
commit576710cae8be19a1e35371860ab85a7bba02d085
treef6c4e5ebaf31facdfbecd9a27732f7ceca987130
parent3e0ea1021a934b16df1f4848815b45ec671f3541
Add FOLLY_NODISCARD for [[nodiscard]] attribute when it exists, FOLLY_WARN_UNUSED_RESULT uses FOLLY_NODISCARD.

Summary: The `nodiscard` attribute was added to standard C++ in C++17. Prefer the standard formulation when it is available; otherwise, use `__attribute__((__warn_unused_result__))` on compilers that support the GNU extensions, and `_Check_return_` on MSVC. The old `FOLLY_WARN_UNUSED_RESULT` is now expands to `FOLLY_NODISCARD`.

Reviewed By: yfeldblum

Differential Revision: D5105137

fbshipit-source-id: 9aa22e81cd9f0b89f9343433aeae3ba365227ccb
folly/Portability.h