llvm-project/clang/test/Analysis/PR47511.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
496 B
C++
Raw Normal View History

// RUN: %clang_analyze_cc1 -std=c++20 -w -analyzer-checker=core -verify %s
// expected-no-diagnostics
namespace std {
struct strong_ordering {
int n;
constexpr operator int() const { return n; }
static const strong_ordering equal, greater, less;
};
constexpr strong_ordering strong_ordering::equal = {0};
constexpr strong_ordering strong_ordering::greater = {1};
constexpr strong_ordering strong_ordering::less = {-1};
} // namespace std
void test() {
2021-08-11 00:19:27 +08:00
// no crash
(void)(0 <=> 0);
}