The following valid translation units
export module a;
namespace n {
}
export module b;
import a;
namespace n {
struct monostate {
friend bool operator==(monostate, monostate) = default;
};
export struct wrapper {
friend bool operator==(wrapper const &, wrapper const &) = default;
monostate m_value;
};
} // namespace n
import b;
static_assert(n::wrapper() == n::wrapper());
are rejected by clang with
In file included from /app/c.cpp:1:
b.cpp:12:67: error: invalid operands to binary expression ('const monostate' and 'const monostate')
12 | friend bool operator==(wrapper const &, wrapper const &) = default;
| ^
c.cpp:3:28: note: in defaulted equality comparison operator for 'wrapper' first required here
3 | static_assert(n::wrapper() == n::wrapper());
| ^
c.cpp:3:28: error: static assertion expression is not an integral constant expression
3 | static_assert(n::wrapper() == n::wrapper());
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~
2 errors generated.
See it live: https://godbolt.org/z/19dG3G7Pb
Introduced by c5e4afe @ChuanqiXu9