Files
clang-p2996/clang/test/Analysis/PR47511.cpp
Valeriy Savchenko 4b958dd6bc [analyzer] Fix crash on spaceship operator (PR47511)
rdar://68954187

Differential Revision: https://reviews.llvm.org/D99181
2021-04-08 20:28:05 +03:00

20 lines
496 B
C++

// 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() {
// no crash
(void)(0 <=> 0);
}