From b899a529a58997d484bda714a8d0effd67063c25 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Mon, 31 Oct 2011 11:21:10 +0000 Subject: [PATCH] Clear compiler warnings [SVN r75185] --- test/boost_has_ftime.ipp | 3 +-- test/boost_no_char16_t.ipp | 3 +++ test/boost_no_char32_t.ipp | 3 +++ test/boost_no_constexpr.ipp | 3 +++ test/boost_no_decltype.ipp | 3 +++ test/boost_no_defaulted_functions.ipp | 2 +- test/boost_no_deleted_functions.ipp | 2 +- test/boost_no_explicit_cvt_ops.ipp | 5 ++++- test/boost_no_initializer_lists.ipp | 3 +++ test/boost_no_lambdas.ipp | 2 +- test/boost_no_noexcept.ipp | 3 +++ test/boost_no_nullptr.ipp | 3 +++ test/boost_no_raw_literals.ipp | 5 +++++ test/boost_no_std_typeinfo.ipp | 2 ++ test/boost_no_unicode_literals.ipp | 2 ++ test/boost_no_variadic_macros.ipp | 4 +++- 16 files changed, 41 insertions(+), 7 deletions(-) diff --git a/test/boost_has_ftime.ipp b/test/boost_has_ftime.ipp index 70964481..ff04baf9 100644 --- a/test/boost_has_ftime.ipp +++ b/test/boost_has_ftime.ipp @@ -14,10 +14,9 @@ namespace boost_has_ftime{ -void f() +void f(FILETIME) { // this is never called, it just has to compile: - FILETIME ft; } int test() diff --git a/test/boost_no_char16_t.ipp b/test/boost_no_char16_t.ipp index 6b8956da..c2f0f59b 100644 --- a/test/boost_no_char16_t.ipp +++ b/test/boost_no_char16_t.ipp @@ -13,9 +13,12 @@ namespace boost_no_char16_t { +void quiet_warning(const char16_t*){} + int test() { const char16_t* p = u"abc"; + quiet_warning(p); return 0; } diff --git a/test/boost_no_char32_t.ipp b/test/boost_no_char32_t.ipp index cee99a64..e03b1567 100644 --- a/test/boost_no_char32_t.ipp +++ b/test/boost_no_char32_t.ipp @@ -12,9 +12,12 @@ namespace boost_no_char32_t { +void quiet_warning(const char32_t*){} + int test() { const char32_t* p = U"abc"; + quiet_warning(p); return 0; } diff --git a/test/boost_no_constexpr.ipp b/test/boost_no_constexpr.ipp index c246e234..bc0ad7cc 100644 --- a/test/boost_no_constexpr.ipp +++ b/test/boost_no_constexpr.ipp @@ -12,6 +12,8 @@ namespace boost_no_constexpr { +void quiet_warning(int){} + constexpr int square(int x) { return x * x; } // from N2235 // from 5.19: @@ -37,6 +39,7 @@ X xx; // OK: unique conversion to int int test() { int i = square(5); + quiet_warning(i); return 0; } diff --git a/test/boost_no_decltype.ipp b/test/boost_no_decltype.ipp index db1aae39..e67f55af 100644 --- a/test/boost_no_decltype.ipp +++ b/test/boost_no_decltype.ipp @@ -13,6 +13,8 @@ namespace boost_no_decltype { +void quiet_warning(int){} + struct test_class { test_class() {} @@ -39,6 +41,7 @@ int test() { int i; decltype(i) j; +// quiet_warning(j); decltype(get_test_class()) k; #ifndef _MSC_VER // Although the VC++ decltype is buggy, we none the less enable support, diff --git a/test/boost_no_defaulted_functions.ipp b/test/boost_no_defaulted_functions.ipp index d6e79762..fcf02fd0 100644 --- a/test/boost_no_defaulted_functions.ipp +++ b/test/boost_no_defaulted_functions.ipp @@ -11,7 +11,7 @@ // DESCRIPTION: The compiler does not support C++0x defaulted functions #if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(BOOST_INTEL_STDCXX0X) -# error Defaulted functions aren't really supported in non-C++0x mode +# error Defaulted functions are not supported in non-C++0x mode #endif namespace boost_no_defaulted_functions { diff --git a/test/boost_no_deleted_functions.ipp b/test/boost_no_deleted_functions.ipp index 21693eb8..00397dff 100644 --- a/test/boost_no_deleted_functions.ipp +++ b/test/boost_no_deleted_functions.ipp @@ -11,7 +11,7 @@ // DESCRIPTION: The compiler does not support C++0x =delete functions #if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(BOOST_INTEL_STDCXX0X) -# error Deleted functions aren't really supported in non-C++0x mode +# error Deleted functions are not supported in non-C++0x mode #endif namespace boost_no_deleted_functions { diff --git a/test/boost_no_explicit_cvt_ops.ipp b/test/boost_no_explicit_cvt_ops.ipp index a040d41e..c0d68c45 100644 --- a/test/boost_no_explicit_cvt_ops.ipp +++ b/test/boost_no_explicit_cvt_ops.ipp @@ -11,11 +11,13 @@ // DESCRIPTION: The compiler does not support C++0x explicit conversion operators #if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(BOOST_INTEL_STDCXX0X) -# error This feature isn't really available in non-C++0x mode +# error This feature is not available in non-C++0x mode #endif namespace boost_no_explicit_conversion_operators { +void quiet_warning(int){} + struct foo { explicit operator int() { return 1; } }; @@ -24,6 +26,7 @@ int test() { foo f; int i = int(f); + quiet_warning(i); return 0; } diff --git a/test/boost_no_initializer_lists.ipp b/test/boost_no_initializer_lists.ipp index 22897e1e..5bc58c22 100644 --- a/test/boost_no_initializer_lists.ipp +++ b/test/boost_no_initializer_lists.ipp @@ -16,6 +16,8 @@ namespace boost_no_initializer_lists { +void quiet_warning(const std::initializer_list&){} + void f(std::initializer_list) { } @@ -25,6 +27,7 @@ int test() std::vector v{"once", "upon", "a", "time"}; // See C++ std 8.5.4 f( { 1, 2, 3, 4 } ); std::initializer_list x = { 1, 2 }; + quiet_warning(x); return 0; } diff --git a/test/boost_no_lambdas.ipp b/test/boost_no_lambdas.ipp index 69216e05..3f6ae2b0 100644 --- a/test/boost_no_lambdas.ipp +++ b/test/boost_no_lambdas.ipp @@ -11,7 +11,7 @@ // DESCRIPTION: The compiler does not support the C++0x lambda feature #if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(BOOST_INTEL_STDCXX0X) -# error This feature isn't really available in non-C++0x mode +# error This feature is not available in non-C++0x mode #endif namespace boost_no_lambdas { diff --git a/test/boost_no_noexcept.ipp b/test/boost_no_noexcept.ipp index 91f2b01a..f041ef41 100644 --- a/test/boost_no_noexcept.ipp +++ b/test/boost_no_noexcept.ipp @@ -11,12 +11,15 @@ namespace boost_no_noexcept { +void quiet_warning(bool){} + int f() noexcept ; int g() noexcept( noexcept( f() ) ) ; int test() { bool b = noexcept( g() ); + quiet_warning(b); return 0; } diff --git a/test/boost_no_nullptr.ipp b/test/boost_no_nullptr.ipp index 254162c9..dd06f7fd 100644 --- a/test/boost_no_nullptr.ipp +++ b/test/boost_no_nullptr.ipp @@ -12,9 +12,12 @@ namespace boost_no_nullptr { +void quiet_warning(const int*){} + int test() { int * p = nullptr; + quiet_warning(p); return 0; } diff --git a/test/boost_no_raw_literals.ipp b/test/boost_no_raw_literals.ipp index 83aa3bc7..3362db30 100644 --- a/test/boost_no_raw_literals.ipp +++ b/test/boost_no_raw_literals.ipp @@ -12,10 +12,15 @@ namespace boost_no_raw_literals { +void quiet_warning(const char*){} +void quiet_warning(const wchar_t*){} + int test() { const char* s = R"(abc)"; + quiet_warning(s); const wchar_t* ws = LR"(abc)"; + quiet_warning(ws); return 0; } diff --git a/test/boost_no_std_typeinfo.ipp b/test/boost_no_std_typeinfo.ipp index 01d5227f..a55a94d8 100644 --- a/test/boost_no_std_typeinfo.ipp +++ b/test/boost_no_std_typeinfo.ipp @@ -13,10 +13,12 @@ namespace boost_no_std_typeinfo { +void quiet_warning(const std::type_info*){} int test() { std::type_info * p = 0; + quiet_warning(p); return 0; } diff --git a/test/boost_no_unicode_literals.ipp b/test/boost_no_unicode_literals.ipp index 6c949cfb..c3be0a19 100644 --- a/test/boost_no_unicode_literals.ipp +++ b/test/boost_no_unicode_literals.ipp @@ -12,10 +12,12 @@ namespace boost_no_unicode_literals { +void quiet_warning(const char*){} int test() { const char* c8 = u8""; + quiet_warning(c8); return 0; } diff --git a/test/boost_no_variadic_macros.ipp b/test/boost_no_variadic_macros.ipp index 0382c21a..7df683b3 100644 --- a/test/boost_no_variadic_macros.ipp +++ b/test/boost_no_variadic_macros.ipp @@ -49,13 +49,15 @@ namespace boost_no_variadic_macros { +void quiet_warning(int){} + template struct test_variadic_macro_class {}; int test() { int x = TEST_VARIADIC_MACRO_STRIP_PARENS(3); - + quiet_warning(x); return 0; }