Can we refer to member variables in a noexcept specification?

跟風遠走 提交于 2019-11-29 04:06:59

Clang is correct here, this is gcc bug 52869. According to [basic.scope.class], emphasis mine:

The potential scope of a name declared in a class consists not only of the declarative region following the name’s point of declaration, but also of all function bodies, default arguments, exception-specifications, and brace-or-equal-initializers of non-static data members in that class (including such things in nested classes).

The scope of m_elements includes the noexcept-specification for size().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!