On Tue, Apr 5, 2016 at 3:13 PM, Richard Smith via cfe-commits <cfe-commits@lists.llvm.org> wrote: > rsmith added a comment. > > The version of this attribute that was voted into the C++ standard > (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0189r1.pdf) does > not support a message, and I expect that is the version that libc++ will want > to use. > > I think we should at least improve Clang's diagnostic message here, maybe > something like: > > warning: value returned by call to function 'blah' should always be used > note: 'blah' declared with attribute 'nodiscard' here
I think this sounds perfectly reasonable. The logic is local to Sema::DiagnoseUnusedExprResult() IIRC, if the OP would like to take a crack at it. Otherwise, it would be handy to file a PR so we track the request. ~Aaron _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits