[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 15 06:19:11 PST 2024
================
@@ -17,10 +17,10 @@ E get_e();
// cxx11-warning at -1 {{use of the 'nodiscard' attribute is a C++17 extension}}
void f() {
- get_s(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ get_s(); // expected-warning {{ignoring return value of type 'S' declared with 'nodiscard' attribute}}
----------------
erichkeane wrote:
```suggestion
get_s(); // expected-warning {{ignoring return value type 'S' declared with 'nodiscard' attribute}}
```
https://github.com/llvm/llvm-project/pull/112521
More information about the cfe-commits
mailing list