id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 114,VC doesn't produce error no code either,nobody,Peter Dimov,"{{{ When Using shared_ptr as shown below, the compiler should not compile but show an error instead. However MS Visual Studio compiles without errors but does not generate any code! The following example shows the problem: #include class D { /* ... */ }; void test() { D *pD = new D; // ... boost::shared_ptr dPtr; // ... // AFAIK the following should not compile dPtr = pD; // Problem with compiler! // what the developer intended actually was: // dPtr = boost::shared_ptr (pD); // which works as expected } Class D dtor is never called and memory leaks. The Visual Studio compiler didn't even create code for the assignment. This is a really dangerous situation, since it is a source of serious bugs which should be avoided during compile time! I really like the shared_ptr, however this compiler problem makes them very risky to use. Looks like the compiler is seriously broken. Is this a known problem? Is there a reasonable workaround? }}}",Bugs,closed,,smart_ptr,None,,Fixed,,