Volunteer for a little test in MSVC 7.0?

I'm trying to make Boost.MultiIndex work for MSVC 7.0 an the regression tests show some weird results. I'm suspicious this can be related with a similar problem in MSVC 6.0 having to do with pointers to members being used as template prams. Would any kind soul with access to MSVC 7.0 run the following test and report the result? TIA Joaquín M López Muñoz Telefónica, Investigación y Desarrollo ****************** struct pair { int x,y; pair(int x_,int y_):x(x_),y(y_){} }; template<int pair::* PtrToPairMember> struct foo { int bar(pair& p){return p.*PtrToPairMember;} }; int main() { pair p(0,1); foo<&pair::x> fx; foo<&pair::y> fy; if(fx.bar(p)!=0||fy.bar(p)!=1)return -1; return 0; } *****************

JOAQUIN LOPEZ MU?Z wrote:
I'm trying to make Boost.MultiIndex work for MSVC 7.0 an the regression tests show some weird results. I'm suspicious this can be related with a similar problem in MSVC 6.0 having to do with pointers to members being used as template prams.
Would any kind soul with access to MSVC 7.0 run the following test and report the result? TIA
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
****************** struct pair { int x,y;
pair(int x_,int y_):x(x_),y(y_){} };
template<int pair::* PtrToPairMember> struct foo { int bar(pair& p){return p.*PtrToPairMember;} };
int main() { pair p(0,1); foo<&pair::x> fx; foo<&pair::y> fy;
if(fx.bar(p)!=0||fy.bar(p)!=1)return -1;
return 0; }
Runs with no errors with Vc7. I ran it in strict Ansi mode with Leon Zolman's STLfilt. Running it against Vc6 in strict Ansi mode with STLfilt gives: MultiIndex.cpp(18): error C2964: invalid expression as template parameter

JOAQUIN LOPEZ MU?Z <joaquin@tid.es> wrote:
Would any kind soul with access to MSVC 7.0 run the following test and report the result?
I have MSVC7 SP1 (beta) . This program returns -1 when compiled with optimizations: /Og /Oy /Ob2 or /Og /Oy /Ob1 or /O2 or /Ox Otherwise I have 0. It works fine with: /Og /Oy /Ob0 and /O2 /Oy- and /O2 /Ob0 Obviously it's bug. I think that /Oy (Frame-Pointer Omission) optimization is at fault here http://msdn.microsoft.com/library/en-us/vccore/html/_core_.2f.Oy.asp B.

Bronek Kozicki <brok <at> rubikon.pl> writes:
JOAQUIN LOPEZ MU?Z <joaquin <at> tid.es> wrote:
Would any kind soul with access to MSVC 7.0 run the following test and report the result?
I have MSVC7 SP1 (beta) . This program returns -1 when compiled with optimizations:
Could you please try with the same compiler options used in the regression tests, as shown in: http://tinyurl.com/34xtf Thanx! Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

Joaquin M Lopez Munoz <joaquin@tid.es> wrote:
Could you please try with the same compiler options used in the regression tests, as shown in:
returns 0. Of course I dropped option "-c" , as I do want to call linker :) I used: /Zm800 -nologo -GX /Z7 /Od /Ob0 /GX /GR /MDd /Op /Zc:forScope /Zc:wchar_t Here is funny thing: linking with dynamic runtime library is enough to "cure" the problem, even with all optimizations turned on. When compiled with following options: /MD /O2 program returns 0. B.

Bronek Kozicki ha escrito:
Joaquin M Lopez Munoz <joaquin@tid.es> wrote:
Could you please try with the same compiler options used in the regression tests, as shown in:
returns 0. Of course I dropped option "-c" , as I do want to call linker :) I used: /Zm800 -nologo -GX /Z7 /Od /Ob0 /GX /GR /MDd /Op /Zc:forScope /Zc:wchar_t
Here is funny thing: linking with dynamic runtime library is enough to "cure" the problem, even with all optimizations turned on. When compiled with following options: /MD /O2
program returns 0.
Anyway, I've just updated Boost.MultiIndex to treat VC7.0 as defective in this area regardless of any settings. Let's see if this fixes the regression tests. Thank you for your help. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
participants (5)
-
Bronek Kozicki
-
Edward Diener
-
JOAQUIN LOPEZ MU?Z
-
Joaquin M Lopez Munoz
-
Joaquín Mª López Muñoz