https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99550
Bug ID: 99550
Summary: ICE (segfault) on arm with -std=c++2a
Product: gcc
Version: 10.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: delleyves at gmx dot ch
Target Milestone: ---
The following code segfaults on "arm-gcc 10.2.1 (none)" (as found on
godbolt.org) when compiled with `-std=c++2a`, but not without that flag.
So does the official ARM GCC release gcc-arm-none-eabi-10-2020-q4-major on
Ubuntu.
On my OSX however, it doesn't segfault. Neither does the x86-64 gcc 10.2 on
godbolt.
```
#include <type_traits>
template <typename value_type_>
struct JoinedRange {
using value_type = value_type_;
template <bool is_const>
struct Iterator {
template <typename T>
using maybe_const_t = std::conditional_t<is_const, const T, T>;
template <bool>
friend class Iterator;
public:
using value_type = JoinedRange::value_type;
using reference = maybe_const_t<value_type>;
using pointer = maybe_const_t<value_type>*;
};
using iterator = Iterator<false>;
using const_iterator = Iterator<true>;
};
template class JoinedRange<int>;
```