From cda937864fb4b12bdb1fc67cf9e99dce903d25eb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 5 Apr 2011 22:29:55 +0000 Subject: [PATCH] Fix VarArgTestCase compilation when type traits are unavailable. 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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/strings/vararg.cpp b/tests/strings/vararg.cpp index c7db2aa23c..b4eec3c834 100644 --- a/tests/strings/vararg.cpp +++ b/tests/strings/vararg.cpp @@ -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 - // 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 -- 2.45.2