https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106371

Lénárd Szolnoki <leni536 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |leni536 at gmail dot com

--- Comment #4 from Lénárd Szolnoki <leni536 at gmail dot com> ---
Rejects valid code when -pedantic-errors is added:

struct S {
    long l : 8;
};

int main() {
    S s;
    int i = {s.l};
}

https://godbolt.org/z/5bq6cMaMx

Produces wrong code when it's used as a constraint:

struct S {
    long l : 8;
};

template <typename T>
requires requires (T t) {
    int{t.l};
}
void foo(T); // 1

void foo(...); // 2

int main() {
    foo(S{}); // calls 2
}

https://godbolt.org/z/We4M1MP1M

Reply via email to