-
Notifications
You must be signed in to change notification settings - Fork 15k
Closed
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second party
Description
#include <cassert>
#include <cstring>
struct foo
{
int member : 8;
int : 24;
bool operator==(const foo&) const = default;
};
int main()
{
// Create two objects with different object representations.
foo a, b;
std::memset(&a, 0xFF, sizeof(foo));
std::memset(&b, 0x99, sizeof(foo));
// Make all members identical to give them the same value representation.
a.member = 0;
b.member = 0;
// This does not pass?!
assert(a == b);
}
Demo: https://godbolt.org/z/75ee78Gss
Unnamed bit fields aren't members, so they shouldn't be compared.
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second party