[Bug c++/95878] New: ICE when compiling code that mixes an empty class, [[no_unique_address]] and non-trivial default and copy constructors
boris.staletic at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jun 24 18:37:57 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95878
Bug ID: 95878
Summary: ICE when compiling code that mixes an empty class,
[[no_unique_address]] and non-trivial default and copy
constructors
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: boris.staletic at gmail dot com
Target Milestone: ---
Hello,
first, apologies for a bad title. I was unsure how to make it more descriptive.
My repro case looks suspiciously like
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90432
However, the bug in 90432 has been fixed in 10.1 and 9.3. I've encountered a
similar code that still triggers an ICE. Just like 90432, gcc 8 works fine.
I've encountered a non-minimal version of this bug while working on the
nanorange library.
The minimal code that causes ICE:
struct istream_iterator {
istream_iterator() {}
istream_iterator(const istream_iterator&) {}
};
istream_iterator next(istream_iterator&& bound) {
return static_cast<istream_iterator>(bound);
}
struct copy_result {
[[no_unique_address]] istream_iterator in;
};
int main() {
copy_result result{next(istream_iterator{})};
}
during RTL pass: expand
<source>: In function 'int main()':
<source>:15:45: internal compiler error: in assign_temp, at function.c:982
15 | copy_result result{next(istream_iterator{})};
| ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
More information about the Gcc-bugs
mailing list