Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-03-29 06:17:55


Dan Bikel wrote:
> Rather disturbingly, the following code compiles (at least, with
> g++-3.3.2):
> #include "boost/shared_ptr.hpp"
> using namespace boost;
> class X {};
> int main() {
> const shared_ptr<X> y;
> delete y;
> }
>
> Normally, when you compile code with delete applied to a non-pointer
> type, you get a compile-time error. What's going on here?

Seems like a g++ specific "feature". g++ allows delete on a member pointer
for some reason. You should probably file a bug report against g++ 3.3. And
I should probably add this test case to the regression tests. ;-)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net