[typeof] Weird VC++ compiler bug
I discovered a strange VC++ bug using Boost.typeof. I am not posting
this to rag VC++ but wondering if there is some known workaround in
Boost or in Boost.config.
#include
AMDG On 05/22/2015 08:02 AM, Edward Diener wrote:
I discovered a strange VC++ bug using Boost.typeof. I am not posting this to rag VC++ but wondering if there is some known workaround in Boost or in Boost.config.
The workaround for most weird Boost.Typeof errors is BOOST_TYPEOF_NESTED_TYPEDEF_TPL. In Christ, Steven Watanabe
On 5/22/2015 11:24 AM, Steven Watanabe wrote:
AMDG
On 05/22/2015 08:02 AM, Edward Diener wrote:
I discovered a strange VC++ bug using Boost.typeof. I am not posting this to rag VC++ but wondering if there is some known workaround in Boost or in Boost.config.
The workaround for most weird Boost.Typeof errors is BOOST_TYPEOF_NESTED_TYPEDEF_TPL.
Thanks ! I saw that macro and saw the mention in the doc of "deconfusing several compilers (notably VC7.1 and VC8.0) on the way", and could not get it into my head that this could still be a problem with VC12. Of course I should have tried it. Oh Microsoft ! What's a little bug that you refuse to fix for at least a decade and counting.
On May 22, 2015 2:57:26 PM EDT, Edward Diener
AMDG
On 05/22/2015 08:02 AM, Edward Diener wrote:
I discovered a strange VC++ bug using Boost.typeof. I am not
On 5/22/2015 11:24 AM, Steven Watanabe wrote: posting
this to rag VC++ but wondering if there is some known workaround in Boost or in Boost.config.
The workaround for most weird Boost.Typeof errors is BOOST_TYPEOF_NESTED_TYPEDEF_TPL.
Thanks !
I saw that macro and saw the mention in the doc of "deconfusing several compilers (notably VC7.1 and VC8.0) on the way", and could not get it into my head that this could still be a problem with VC12. Of course I should have tried it.
Oh Microsoft ! What's a little bug that you refuse to fix for at least a decade and counting.
Isn't the problem the lack of two-phase lookup in that compiler? ___ Rob (Sent from my portable computation engine)
On 5/23/2015 8:12 AM, Rob Stewart wrote:
On May 22, 2015 2:57:26 PM EDT, Edward Diener
wrote: AMDG
On 05/22/2015 08:02 AM, Edward Diener wrote:
I discovered a strange VC++ bug using Boost.typeof. I am not
On 5/22/2015 11:24 AM, Steven Watanabe wrote: posting
this to rag VC++ but wondering if there is some known workaround in Boost or in Boost.config.
The workaround for most weird Boost.Typeof errors is BOOST_TYPEOF_NESTED_TYPEDEF_TPL.
Thanks !
I saw that macro and saw the mention in the doc of "deconfusing several compilers (notably VC7.1 and VC8.0) on the way", and could not get it into my head that this could still be a problem with VC12. Of course I should have tried it.
Oh Microsoft ! What's a little bug that you refuse to fix for at least a decade and counting.
Isn't the problem the lack of two-phase lookup in that compiler?
Considering that in my example which fails the class template never gets instantiated it does not seem that the lack of two-phase lookup should cause such an error. But whatever... Microsoft has a well-known system in place by which they decide that known bugs should not be fixed if they don't think it is important enough to do so.
AMDG On 05/23/2015 07:45 AM, Edward Diener wrote:
On 5/23/2015 8:12 AM, Rob Stewart wrote:
On May 22, 2015 2:57:26 PM EDT, Edward Diener
wrote: Oh Microsoft ! What's a little bug that you refuse to fix for at least a decade and counting.
Isn't the problem the lack of two-phase lookup in that compiler?
Considering that in my example which fails the class template never gets instantiated it does not seem that the lack of two-phase lookup should cause such an error. But whatever... Microsoft has a well-known system in place by which they decide that known bugs should not be fixed if they don't think it is important enough to do so.
You can't blame microsoft too much for this particular problem, since the "native" typeof implementation of msvc relies on a compiler bug. In Christ, Steven Watanabe
Steven Watanabe wrote:
On 05/23/2015 07:45 AM, Edward Diener wrote: ...
But whatever... Microsoft has a well-known system in place by which they decide that known bugs should not be fixed if they don't think it is important enough to do so.
A bit unfair, methinks. They do what everyone does - try to strike a balance between adding features, fixing bugs and not breaking too much code.
You can't blame microsoft too much for this particular problem, since the "native" typeof implementation of msvc relies on a compiler bug.
Why doesn't Typeof use decltype on VS 2013?
2015-05-23 18:33 GMT+02:00 Steven Watanabe
AMDG
On 05/23/2015 09:44 AM, Peter Dimov wrote:
Why doesn't Typeof use decltype on VS 2013?
Probably because Typeof hasn't had a maintainer since before decltype. It doesn't appear to use decltype for any compiler.
I don't think it can. The semantics of BOOST_TYPEOF is that of: auto x = expr; The semantics of decltype are quire different. For instance, auto and BOOST_TYPEOF and GCC's __typeof__ never deduce references -- always values. decltype on the other hand can deduce references. I guess BOOST_TYPEOF could be implemented with decltype(auto). Regards, &rzej
On Wed, May 27, 2015 at 4:53 PM, Andrzej Krzemienski
2015-05-23 18:33 GMT+02:00 Steven Watanabe
: AMDG
On 05/23/2015 09:44 AM, Peter Dimov wrote:
Why doesn't Typeof use decltype on VS 2013?
Probably because Typeof hasn't had a maintainer since before decltype. It doesn't appear to use decltype for any compiler.
I don't think it can. The semantics of BOOST_TYPEOF is that of: auto x = expr;
The semantics of decltype are quire different. For instance, auto and BOOST_TYPEOF and GCC's __typeof__ never deduce references -- always values. decltype on the other hand can deduce references.
As long as BOOST_TYPEOF is less precise than decltype it can be emulated, can it not?
---------- Forwarded message ----------
From: Andrey Semashev
2015-05-23 18:33 GMT+02:00 Steven Watanabe
: AMDG
On 05/23/2015 09:44 AM, Peter Dimov wrote:
Why doesn't Typeof use decltype on VS 2013?
Probably because Typeof hasn't had a maintainer since before decltype. It doesn't appear to use decltype for any compiler.
I don't think it can. The semantics of BOOST_TYPEOF is that of: auto x = expr;
The semantics of decltype are quire different. For instance, auto and BOOST_TYPEOF and GCC's __typeof__ never deduce references -- always values. decltype on the other hand can deduce references.
As long as BOOST_TYPEOF is less precise than decltype it can be
emulated, can it not?
You're right it can. I think the following would work:
typename std::decay
Andrzej Krzemienski wrote:
2015-05-23 18:33 GMT+02:00 Steven Watanabe
: AMDG
On 05/23/2015 09:44 AM, Peter Dimov wrote:
Why doesn't Typeof use decltype on VS 2013?
Probably because Typeof hasn't had a maintainer since before decltype. It doesn't appear to use decltype for any compiler.
I don't think it can. The semantics of BOOST_TYPEOF is that of: auto x = expr;
It's not a problem to pass the result of decltype through decay<> or to use template<class T> T f( T ); decltype(f(expr));
On 5/23/2015 11:44 AM, Peter Dimov wrote:
Steven Watanabe wrote:
But whatever... Microsoft has a well-known system in place by which
On 05/23/2015 07:45 AM, Edward Diener wrote: ... they > decide that known bugs should not be fixed if they don't think it is > important enough to do so.
A bit unfair, methinks. They do what everyone does - try to strike a balance between adding features, fixing bugs and not breaking too much code.
Not fixing a bug over 10 years time ? That's not striking a balance to me.
You can't blame microsoft too much for this particular problem, since the "native" typeof implementation of msvc relies on a compiler bug.
Why doesn't Typeof use decltype on VS 2013?
On 5/23/2015 11:04 AM, Steven Watanabe wrote:
AMDG
On 05/23/2015 07:45 AM, Edward Diener wrote:
On 5/23/2015 8:12 AM, Rob Stewart wrote:
On May 22, 2015 2:57:26 PM EDT, Edward Diener
wrote: Oh Microsoft ! What's a little bug that you refuse to fix for at least a decade and counting.
Isn't the problem the lack of two-phase lookup in that compiler?
Considering that in my example which fails the class template never gets instantiated it does not seem that the lack of two-phase lookup should cause such an error. But whatever... Microsoft has a well-known system in place by which they decide that known bugs should not be fixed if they don't think it is important enough to do so.
You can't blame microsoft too much for this particular problem, since the "native" typeof implementation of msvc relies on a compiler bug.
Does it rely on the exact compiler bug my OP illustrates ? Even if it does it is hard to imagine that there would be no Boost.typeof for VC++, since there is an implementation for more conforming compilers.
participants (6)
-
Andrey Semashev
-
Andrzej Krzemienski
-
Edward Diener
-
Peter Dimov
-
Rob Stewart
-
Steven Watanabe