[config] call to destructor of temporary

Hi, I have had some trouble debugging some code with clang-2.9 c++0x. The reason was a known bug on the compiler as it doesn't call the destructor of temporaries at the end of the expression. Is there a macro stating this missing feature? Best, Vicente

On 15/10/2012 00:24, Vicente J. Botet Escriba wrote:
Hi,
I have had some trouble debugging some code with clang-2.9 c++0x. The reason was a known bug on the compiler as it doesn't call the destructor of temporaries at the end of the expression.
Is there a macro stating this missing feature?
That's a severe bug, doesn't look like any workaround would fix it

Le 15/10/12 01:08, Mathias Gaunard a écrit :
On 15/10/2012 00:24, Vicente J. Botet Escriba wrote:
Hi,
I have had some trouble debugging some code with clang-2.9 c++0x. The reason was a known bug on the compiler as it doesn't call the destructor of temporaries at the end of the expression.
Is there a macro stating this missing feature?
That's a severe bug, doesn't look like any workaround would fix it
Yes you are right. In my particular case the bug manifest at the test side and the library already provided an interface that allows workaround S s; #if BOOST_NO_XXX { U u=s.make_u(); u->append("foo/"); } #else s->append("foo/"); // S::operator->() returns a temporary for which the destructor must be called here #endif Ah, the bug doesn't appear with all the temporaries, and that s.make_u()->append("foo/"); works. I don't know yet if this is limited to the temporaries that operator-> could return. While this is a severe bug, the workaround seems reasonable. Of course on compilers with such a bug S::operator->() will not be available. Note that I have no special interest in supporting this compiler, if the Boost community don't support it. Best, Vicente P.S. U S::operator->() { return S(*this)); } U S::make_u() { return S(*this)); }

I have had some trouble debugging some code with clang-2.9 c++0x. The reason was a known bug on the compiler as it doesn't call the destructor of temporaries at the end of the expression.
Is there a macro stating this missing feature?
No, because no one has ever mentioned it before. Besides it's not a missing feature, it's a pretty compiler specific serious bug, so I suggest a BOOST_WORKAROUND - if such a workaround is even possible in that case :-( John.

On Mon, Oct 15, 2012 at 12:45 PM, John Maddock <boost.regex@virgin.net> wrote:
I have had some trouble debugging some code with clang-2.9 c++0x. The reason was a known bug on the compiler as it doesn't call the destructor of temporaries at the end of the expression.
Is there a macro stating this missing feature?
No, because no one has ever mentioned it before.
Besides it's not a missing feature, it's a pretty compiler specific serious bug, so I suggest a BOOST_WORKAROUND - if such a workaround is even possible in that case :-(
FWIW, I remember Sun Pro compiler also had similar behavior, only it was fixable with a compiler switch.
participants (4)
-
Andrey Semashev
-
John Maddock
-
Mathias Gaunard
-
Vicente J. Botet Escriba