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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Add typename to make it C++14:

namespace std {
template <typename _Tp, int _Nm> struct __array_traits {
  typedef _Tp _Type[_Nm];
};
template <typename _Tp, int _Nm> struct array {
  typename __array_traits<_Tp, _Nm>::_Type _M_elems;
};
} // namespace std
struct scope_guard {
  constexpr scope_guard(scope_guard &&) {}
  template <int count> static auto array(void()) {
    std::array<scope_guard, count> r;
    return r;
  }
  scope_guard() = default;
};
void test() { scope_guard::array<2>(test); }

Reply via email to