The following text was added to the warn_usued_result attribute in clang 10:
"A string literal may optionally be provided to the attribute, which will be reproduced in any resulting diagnostics. Redeclarations using different forms of the attribute (with or without the string literal or with different string literal contents) are allowed. If there are redeclarations of the entity with differing string literals, it is unspecified which one will be used by Clang in any resulting diagnostics.
error:
clang:
The following text was added to the warn_usued_result attribute in clang 10: "A string literal may optionally be provided to the attribute, which will be reproduced in any resulting diagnostics. Redeclarations using different forms of the attribute (with or without the string literal or with different string literal contents) are allowed. If there are redeclarations of the entity with differing string literals, it is unspecified which one will be used by Clang in any resulting diagnostics.
"Additionally, discarded temporaries resulting from a call to a constructor marked with
[[nodiscard]]
or a constructor of a type marked[[nodiscard]]
will also diagnose. This also applies to type conversions that use the annotated[[nodiscard]]
constructor or result in an annotated type." https://releases.llvm.org/10.0.0/tools/clang/docs/AttributeReference.html#nodiscard-warn-unused-result