Рассматривают:noexcept зависит от noexcept функции члена
class test {
private:
int n;
int impl() const noexcept {
return n;
}
public:
test() = delete;
test (int n) noexcept : n(n) { }
int get() const noexcept(noexcept(impl())) {
return impl();
}
};
НКУ говорит нет:
test.cpp:27:43: error: cannot call member function 'int test::impl() const' with
out object
int get() const noexcept(noexcept(impl())) {
Аналогично:
test.cpp:27:38: error: invalid use of 'this' at top level
int get() const noexcept(noexcept(this->impl())) {
и
test.cpp:31:58: error: invalid use of incomplete type 'class test'
int get() const noexcept(noexcept(std::declval<test>().impl())) {
^
test.cpp:8:7: error: forward declaration of 'class test'
class test {
Является ли это предполагаемым поведением в соответствии со стандартом или ошибкой в GCC (4.8.0)?