[PATCH] Add [[nodiscard]] attribute to C++17 components

Jonathan Wakely jwakely@redhat.com
Thu Nov 23 22:52:00 GMT 2017


On 23/11/17 22:40 +0000, Jonathan Wakely wrote:
>C++17 added the [[nodiscard]] attribute, similar to GCC's
>warn_unused_result. The C++2a draft requires it to be used in several
>places. This patch adds it where required on components which are new
>to C++17, which are still experimental and so I'm changing them in
>stage 3.

This adds the other [[nodiscard]] attributes required by C++2a, but
using [[__nodiscard__]] so it can be enabled in C++11 and C++14, where
nodiscard is not a reserved name.

I don't plan to commit this until stage 1 (and don't have tests for it
yet anyway).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 17730 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20171123/c60de2ce/attachment.bin>


More information about the Libstdc++ mailing list