[bind] code sample crashing MS compiler

This following code sample will crash the MS compiler version 8. I
hope there are some MS folks reading this mailing list, since I have
no idea where else to post this.
#include

On Fri, Dec 19, 2008 at 1:42 PM, Christian Henning
This following code sample will crash the MS compiler version 8. I hope there are some MS folks reading this mailing list, since I have no idea where else to post this.
#include
struct A { void operator() () { boost::bind( &A::lookup, *this, unsigned char() )(); }
void lookup( unsigned char& c ) {} };
int main(int argc, char* argv[]) { A()();
return 0; }
I know the code is not suppose to compile. Uncommenting the this pointer in the bind construct will make the code compile fine.
MSVC 8 has several similar crashes. At least it does not crash if you feed it valid C++ :) Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode

This following code sample will crash the MS compiler version 8. I hope there are some MS folks reading this mailing list, since I have no idea where else to post this.
#include
struct A { void operator() () { boost::bind( &A::lookup, *this, unsigned char() )(); }
void lookup( unsigned char& c ) {} };
int main(int argc, char* argv[]) { A()();
return 0; }
I know the code is not suppose to compile. Uncommenting the this pointer in the bind construct will make the code compile fine.
The proper place to post Microsoft bugs (for any product) is at http://connect.microsoft.com. Look for the "Visual Studio and .NET Framework" section and file a bug report there. They will look at. They always do. Whether or not they actually do anything about it or not is another story. I suggest that you try compiling it in VS2008 (express edition if you don't have it) or even better with the VS2010 CTP preview. If the bug still exists, then that's where they'll most likely fix it (in VS2010). -- Bill --

There's an issue with pointer to member functions.
Here's what I've traced boost bind error to:
template<class F> void g(F f){};
struct S { void m(){}; };
int _tmain(int argc, _TCHAR* argv[])
{
S s;
g(s.*&S::m);
return 0;
}
Here's a looking like legal code that fails to compile with the same crash:
class foo;
template
participants (4)
-
Alexander Gutenev
-
Bill Buklis
-
Christian Henning
-
Emil Dotchevski