[clang] [Clang] Fix crash on malformed std::partial_ordering static members (PR #172001)
Oliver Hunt via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 12 23:18:17 PST 2025
================
@@ -67,3 +67,28 @@ struct comparable_t {
expected-note {{defaulted 'operator<=>' is implicitly deleted because defaulted comparison of vector types is not supported}}
};
} // namespace GH137452
+
+namespace GH170015 {
----------------
ojhunt wrote:
Would you mind adding an additional test - it will require a new file alas - to cover a few other cases:
```cpp
namespace std {
using partial_ordering = int;
}
```
```cpp
namespace std {
struct partial_ordering;
}
```
This last one just a paranoia check
```cpp
namespace std {
template <class> struct `partial_ordering` {
static const partial_ordering less;
static const partial_ordering equivalent;
static const partial_ordering greater;
static const partial_ordering unordered;
};
}
```
My approach to the test would be a single file with multiple invocations with -DTEST1, -DTEST2, .. etc and use that to select the definition being tested.
https://github.com/llvm/llvm-project/pull/172001
More information about the cfe-commits
mailing list