GCC中继(9.0)和Clang中继(7.0)在以下代码上存在分歧:
template<int size_>
struct BadArray {
static constexpr int size = size_;// GCC complains due to this indirection
using Self = BadArray<size>;
Self& operator=(const Self&) noexcept = default;
};
使用GCC编译失败,并显示错误消息
error: 'BadArray<size_>::Self& BadArray<size_>::operator=(const Self&)' cannot be defaulted
Clang接受代码(live example with GCC 8.1 and Clang 6.0)。