]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix VarArgTestCase compilation when type traits are unavailable.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 5 Apr 2011 22:29:55 +0000 (22:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 5 Apr 2011 22:29:55 +0000 (22:29 +0000)
When type traits are unavailable we can't check whether a type can be passed
to a vararg function but we still need to pass a copyable object to
wxString::Format() for the code to compile, even if we just want to check that
it will fail with the assert at run-time.

Closes #13118.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/strings/vararg.cpp

index c7db2aa23c9d44afd97aa59bd345badf610995de..b4eec3c83408aa9470ed373b14125a7bb56b692b 100644 (file)
@@ -240,12 +240,12 @@ void VarArgTestCase::ArgsValidation()
     WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("foo%i%n", 42, &swritten) );
 
     // the following test (correctly) fails at compile-time with <type_traits>
-    // and it also (wrongly) fails when using VC6 because it somehow tries to
-    // use (inaccessible) VarArgTestCase copy ctor (FIXME-VC6)
-#if !defined(HAVE_TYPE_TRAITS) && !defined(HAVE_TR1_TYPE_TRAITS) && \
-        !defined(__VISUALC6__)
-    VarArgTestCase& somePOD = *this;
-    WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("%s", somePOD) );
+#if !defined(HAVE_TYPE_TRAITS) && !defined(HAVE_TR1_TYPE_TRAITS)
+    wxObject obj;
+    WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("%s", obj) );
+
+    wxObject& ref = obj;
+    WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("%s", ref) );
 #endif
 
     // %c should accept integers too