Article ID: 166719
Article Last Modified on 7/5/2005
A 1st throw B 2nd throw C 1st throwHowever, if global optimization (/Og) is enabled, the output is:
A 1st throw B 2nd throw C 2nd throw
#pragma optimize("g", off)
//test.cpp
/* Compiler options needed : /GX */
#include <iostream>
using namespace std;
#pragma optimize("g", on)
void main() {
try
{
char* pStr = NULL;
try
{
throw "1st throw\n";
}
catch( char* str )
{
cout << "A " << str;
try
{
throw "2nd throw\n";
}
catch( char* str )
{
cout <<"B "<< str;
}
throw;
}
}
catch ( char* str )
{
cout <<"C "<< str;
}
}
Keywords: kbbug kbfix kbvc600fix kbcode KB166719