Author: mordante
Date: Thu Dec  4 20:54:48 2008
New Revision: 31269

URL: http://svn.gna.org/viewcvs/wesnoth?rev=31269&view=rev
Log:
Add a fix for a crash in MSVC 2008.

MSVC 2008 doesn't seem to like
typedef typename foo<bar>::rhs_type rhs_type;
It ends with an internal compiler error, so changed the typedef to use
different names for rhs_type.

Modified:
    trunk/src/copy_policy.hpp
    trunk/src/tests/test_policy.cpp

Modified: trunk/src/copy_policy.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/copy_policy.hpp?rev=31269&r1=31268&r2=31269&view=diff
==============================================================================
--- trunk/src/copy_policy.hpp (original)
+++ trunk/src/copy_policy.hpp Thu Dec  4 20:54:48 2008
@@ -168,7 +168,15 @@
 struct tcopy_policy : public base, public copy_policy<tcopy_policy<base, 
copy_policy> >
 {
        typedef copy_policy<tcopy_policy<base, copy_policy> > policy;
-       typedef typename tcopy_policy<base, copy_policy>::rhs_type rhs_type;
+       /* 
+        * This typedef first was
+        * typedef typename tcopy_policy<base, copy_policy>::rhs_type rhs_type;
+        *
+        * Unfortunately MSVC 2008 chokes on it and aborts with an internal
+        * compiler error. So used another name for the type.
+        */
+       typedef typename tcopy_policy<base, copy_policy>::rhs_type 
+               tcopy_policy_rhs_type;
 
        tcopy_policy()
                : base()
@@ -179,7 +187,7 @@
 #endif
        }
 
-       tcopy_policy(rhs_type rhs) 
+       tcopy_policy(tcopy_policy_rhs_type rhs) 
                : base(rhs)
                , policy(rhs)
        { 
@@ -189,7 +197,7 @@
                copy(rhs); 
        }
 
-       tcopy_policy& operator=(rhs_type rhs) 
+       tcopy_policy& operator=(tcopy_policy_rhs_type rhs) 
        {
 #if COPY_POLICY_DEBUG
                std::cerr << "tcopy_policy: assignment operator.\n";

Modified: trunk/src/tests/test_policy.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/tests/test_policy.cpp?rev=31269&r1=31268&r2=31269&view=diff
==============================================================================
--- trunk/src/tests/test_policy.cpp (original)
+++ trunk/src/tests/test_policy.cpp Thu Dec  4 20:54:48 2008
@@ -34,7 +34,14 @@
 struct ttest : public copy_policy<ttest<copy_policy> >
 {
        typedef copy_policy<ttest<copy_policy> > policy;
-       typedef typename ttest<copy_policy>::rhs_type rhs_type;
+       /* 
+        * This typedef first was
+        * typedef typename ttest<copy_policy>::rhs_type rhs_type;
+        *
+        * Unfortunately MSVC 2008 chokes on it and aborts with an internal
+        * compiler error. So used another name for the type.
+        */
+       typedef typename ttest<copy_policy>::rhs_type ttest_rhs_type;
 
        ttest()
                : policy()
@@ -48,7 +55,7 @@
 #endif
        }
 
-       ttest(rhs_type rhs) 
+       ttest(ttest_rhs_type rhs) 
                : policy(rhs)
                , copied_constructed_(true)
                , assigned_(rhs.assigned_)
@@ -61,7 +68,7 @@
                copy(rhs); 
        }
 
-       ttest& operator=(rhs_type rhs) 
+       ttest& operator=(ttest_rhs_type rhs) 
        {
 #if TEST_POLICY_DEBUG
                std::cerr << __func__ << ".\n";


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to