Re: VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Fri, 22 Feb 2008 16:26:01 -0800
Victor Bazarov wrote:
Carl Daniel [VC++ MVP] wrote:
What if you turn off whole-program optimization, which is on by
default in release builds under 2005 and later?
I tried on 2008 EE, it didn't make a difference. The code that
causes is even simpler:
struct B {};
struct A : virtual B {};
int main()
{
B* b = reinterpret_cast<A*>(0);
}
(no precompiled headers, not "_t" stuff, no unneeded 'return'), and
it ICEs while _compiling_, not after the linker is done with it.
That's a pretty darn simple repro case.
I was able to repro it on 2008 Team Edition. Compiling with any combination
of -Oy -Oi -Ob -Os -Ot works fine, but including -Og, -O1 or -O2 causes the
ICE.
If this is an issue in real code, adding #pragma optimize("g",off) before
and #pragma optimize("g",on) after the function containing the
reinterpret_cast could be a usable workaround.
Has anyone opened a bug report on Connect?
-cd
.
- Follow-Ups:
- Re: VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- From: jesse.pepper@xxxxxxxxx
- Re: VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- References:
- VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- From: jesse.pepper@xxxxxxxxx
- Re: VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- From: David Lowndes
- Re: VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- From: David Wilkinson
- Re: VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- From: David Lowndes
- Re: VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- From: jesse.pepper@xxxxxxxxx
- Re: VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- From: David Lowndes
- Re: VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- From: Carl Daniel [VC++ MVP]
- Re: VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- From: Victor Bazarov
- VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- Prev by Date: Thanks to both of you
- Next by Date: Re: malloc() size limit
- Previous by thread: Re: VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- Next by thread: Re: VC2008 Bug: optimising static_cast to a virtual base gives C1001 internal compile error
- Index(es):
Relevant Pages
|
Loading