RE: [GD-Windows] DEVENV template error crashes
Brought to you by:
vexxed72
From: Jon W. <hp...@mi...> - 2004-11-10 17:07:17
|
> error reporting on template stuff has always been a bit flaky on MS stuff. > Best approach i've found so far is: if you get that error, and there's a > template nearby, assume you've got a bug in your template code somewhere. > Binary search your code for the thing that's causing the compiler to barf > (#ifdef 0 bits of it out). Pin down bug, fix it, move on. Far from ideal. If > anyone has a better solution, i'd love to hear it :) So I already did that. In fact, I already piped the code through GCC to find what the problem is, and GCC liked it just fine. I'm pasting the repro case below. Note that blind random fiddling found that removing the (redundant) "virtual" from the declaration of Derived::someFunction will avoid the internal compiler error, although it took quite a while to get to that point from the initial C1001. Also, I tried to report this simple repro case on the MSDN LadyBug site, but it appears they don't accept bug reports for their currently active released products (MSVC 2003) -- only for their current beta 2005. I'm not about to download and install a beta product just to report a bug I've found in their shipped product, because I'm trying to get MY job done, not theirs. I find their approach to customer support more than a little arrogant in cases like these... Cheers, / h+ template< class From, class To, void (From::* Func)( To * ) > class RefPointer { public: RefPointer() { from_ = 0; to_ = 0; } void setThisPointer( From * from ) { from_ = from; } void setPointer( To * to ) { to_ = to; } void onTermination() { (from_->*Func)( to_ ); to_ = 0; } From * from_; To * to_; }; class FirstBase { public: virtual void whatever() = 0; }; class Base { public: virtual void someFunction( FirstBase * ) = 0; }; class Derived : private Base { public: virtual void someFunction( FirstBase * ); typedef RefPointer< Derived, FirstBase, &Derived::someFunction > SomePtr; }; int main() { Derived::SomePtr p; return 0; } |