error: exception specification is not available until end of class definition

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

error: exception specification is not available until end of class definition

Joan Lluch via cfe-dev
Hi, 

Let's say we have a simple test.cpp file.

class A {
public:
virtual ~A() {};
};

class B: public A {
public:
struct C {
~C() throw() {};
};
C c;
//~B();
};

I got an error 

test.cpp:11:4: error: exception specification is not available until end of class definition

        C c;

          ^

1 error generated.

when trying to compile it with clang++ -c test.cpp. It works fine with xcode clang but the error occurs when using clang from trunk. 

Thanks. 

Best regards,
Han






_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev