#include <iostream>
using namespace std;
class A
{
public:
void g() noexcept {}
void f() noexcept( noexcept( g() )) {};
};
A a;
int main()
{
cout<<noexcept(a.f())<<endl;
return 0;
}
When I try to compile this program with gcc 5.1.1, I got an error -
Error: cannot call member function without object ‘void A::g()’
|| void f() noexcept( noexcept( g() )) {};
However, in clang++3.6 this can be compiled and the output is 1
Is there any way to resolve this problem?