diff --git a/Source/kwsys/kwsysPlatformCxxTests.cxx b/Source/kwsys/kwsysPlatformCxxTests.cxx
index c1feca1d79f449a90e7f1b895a8cc5a05ef7b30d..f3814c0b37c1e5f454c252d829d4ec995118763c 100644
--- a/Source/kwsys/kwsysPlatformCxxTests.cxx
+++ b/Source/kwsys/kwsysPlatformCxxTests.cxx
@@ -86,14 +86,15 @@ template <class U>
 class A
 {
 public:
-  U* ptr;
-  template <class V> U m(V* p) { return *ptr = *p; }
+  U u;
+  A(): u(0) {}
+  template <class V> V m(V* p) { return *p = u; }
 };
 
 int main()
 {
-  A<int> a;
-  short s = 0;
+  A<short> a;
+  int s = 1;
   return a.m(&s);
 }
 #endif