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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
ICEs likely since r185587, before it has been rejected:
pr84874.C: In function ‘void sema_init(semaphore*)’:
pr84874.C:30:2: error: no match for ‘operator=’ in ‘* sem = {{{{0}},
{"(*sem).lock"}}}’
pr84874.C:30:2: note: candidates are:
pr84874.C:19:8: note: semaphore& semaphore::operator=(const semaphore&)
pr84874.C:19:8: note:   no known conversion for argument 1 from
‘<brace-enclosed initializer list>’ to ‘const semaphore&’
pr84874.C:19:8: note: semaphore& semaphore::operator=(semaphore&&)
pr84874.C:19:8: note:   no known conversion for argument 1 from
‘<brace-enclosed initializer list>’ to ‘semaphore&&’

ICEs even with -std=c++2a, where this is valid code (previously it has been
just GNU C++ extension), so with -std=c++17 and earlier -pedantic-errors
rejects it (and ICEs during error-recovery).
With added .key = 0, before .name = it works.

Reply via email to