Jul*_*ius 5 c++ g++ c++11 clang++
GCC trunk(9.0)和Clang trunk(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;
};
Run Code Online (Sandbox Code Playgroud)
使用GCC进行编译失败,并显示错误消息
error: 'BadArray<size_>::Self& BadArray<size_>::operator=(const Self&)' cannot be defaulted
Run Code Online (Sandbox Code Playgroud)
而Clang接受代码(GCC 8.1和Clang 6.0的实例).