From 772b121a14dfba596de9215b852878b5b47358a4 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 13 Apr 2005 14:13:05 -0400 Subject: [PATCH] BUG: Fixed member template test to not produce a test program that crashes when it runs. --- Source/kwsys/kwsysPlatformCxxTests.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/kwsys/kwsysPlatformCxxTests.cxx b/Source/kwsys/kwsysPlatformCxxTests.cxx index c1feca1d7..f3814c0b3 100644 --- a/Source/kwsys/kwsysPlatformCxxTests.cxx +++ b/Source/kwsys/kwsysPlatformCxxTests.cxx @@ -86,14 +86,15 @@ template class A { public: - U* ptr; - template U m(V* p) { return *ptr = *p; } + U u; + A(): u(0) {} + template V m(V* p) { return *p = u; } }; int main() { - A a; - short s = 0; + A a; + int s = 1; return a.m(&s); } #endif