aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Analysis/PR47511.cpp
blob: d42799f4fbde5e6be4653c7b2ff655607e4e1226 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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);
}