summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/kwsysPlatformCxxTests.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-04-13 18:13:05 (GMT)
committerBrad King <brad.king@kitware.com>2005-04-13 18:13:05 (GMT)
commit772b121a14dfba596de9215b852878b5b47358a4 (patch)
tree8a953cb7526ac9fb17652844b89530b6c12e8332 /Source/kwsys/kwsysPlatformCxxTests.cxx
parentbddcf4ec973c8aeac716942904d4a4e05ce101c2 (diff)
downloadCMake-772b121a14dfba596de9215b852878b5b47358a4.zip
CMake-772b121a14dfba596de9215b852878b5b47358a4.tar.gz
CMake-772b121a14dfba596de9215b852878b5b47358a4.tar.bz2
BUG: Fixed member template test to not produce a test program that crashes when it runs.
Diffstat (limited to 'Source/kwsys/kwsysPlatformCxxTests.cxx')
-rw-r--r--Source/kwsys/kwsysPlatformCxxTests.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/kwsys/kwsysPlatformCxxTests.cxx b/Source/kwsys/kwsysPlatformCxxTests.cxx
index c1feca1..f3814c0 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