Boost logo

Boost Users :

Subject: Re: [Boost-users] fatal error C1001 with VS2010, boost 1.49, and shared_ptr.hpp
From: Phillip Hellewell (sshock_at_[hidden])
Date: 2012-04-30 13:14:54


On Mon, Apr 30, 2012 at 10:54 AM, Phillip Hellewell <sshock_at_[hidden]> wrote:
> I'm upgrading to boost 1.49 and getting this fatal error while
> compiling a source file that uses shared_ptr:
>
> 1>C:\mycomps\base\target\dependency\include\boost/smart_ptr/shared_ptr.hpp(362):
> fatal error C1001: An internal error has occurred in the compiler.

Good news. Luckily I was able to pinpoint the exact line of code
causing VS to crash, and two different workarounds:

Crashes VS:
        return Foo_ptr(new Foo());

Workaround 1:
        return boost::shared_ptr<Foo>(new Foo());

Workaround 2:
        Foo_ptr ret(new Foo());
        return ret;

(Foo_ptr is a typedef of boost::shared_ptr<Foo>)

Phillip


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