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
WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("foo%i%n", 42, &swritten) );
// the following test (correctly) fails at compile-time with <type_traits>
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
#endif
// %c should accept integers too