Issue |
141536
|
Summary |
[clang] Discarding a use of a [[nodiscard]] `consteval` function does not emit a nodiscard warning
|
Labels |
clang
|
Assignees |
|
Reporter |
smallp-o-p
|
It emits an `_expression_ result unused` warning instead. GCC emits the `nodiscard` warning.
```
[[nodiscard]] consteval int foo(){ return 1; }
[[nodiscard]] int foo2(){ return 1; }
int main(){
foo(); // <-- emits an _expression_ result unused warning
foo2();
}
```
See: https://godbolt.org/z/9fEG8c5Mx
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs