-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Open
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerfalse-negativeWarning doesn't fire when it shouldWarning doesn't fire when it shouldlibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
#include <vector>
void f(const std::vector<int>& v) {
v.end() + 1;
}https://godbolt.org/z/zdvexjY5j
There is no warning with -stdlib=libc++.
With -stdlib=libstdc++:
<source>:4:5: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
4 | v.end() + 1;
| ^~~~~~~~~~~
1 warning generated.
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerfalse-negativeWarning doesn't fire when it shouldWarning doesn't fire when it shouldlibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.