From 1f815065bb0ac85384955f66d54ae77dbd66e8f5 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 2 May 2014 09:29:30 +0100 Subject: [PATCH] Fix gcc-4.9.0 warnings --- test/has_binary_operators.hpp | 13 +++++++------ test/has_postfix_operators.hpp | 11 ++++++----- test/has_prefix_operators.hpp | 9 +++++---- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/test/has_binary_operators.hpp b/test/has_binary_operators.hpp index 99be9a4..681cde9 100644 --- a/test/has_binary_operators.hpp +++ b/test/has_binary_operators.hpp @@ -30,7 +30,7 @@ struct ret { }; struct internal { ret operator BOOST_TT_TRAIT_OP (const internal&) const; }; struct external { }; -ret operator BOOST_TT_TRAIT_OP (const external&, const external&); +inline ret operator BOOST_TT_TRAIT_OP (const external&, const external&) { return ret(); } struct comma1_ret { }; struct ret_with_comma1 { comma1_ret operator,(int); }; @@ -38,14 +38,14 @@ struct ret_with_comma1 { comma1_ret operator,(int); }; struct internal_comma1 { ret_with_comma1 operator BOOST_TT_TRAIT_OP (const internal_comma1&) const; }; struct external_comma1 { }; -ret_with_comma1 operator BOOST_TT_TRAIT_OP (const external_comma1&, const external_comma1&); +ret_with_comma1 operator BOOST_TT_TRAIT_OP (const external_comma1&, const external_comma1&) { return ret_with_comma1(); } struct ret_with_comma2 { void operator,(int); }; struct internal_comma2 { ret_with_comma2 operator BOOST_TT_TRAIT_OP (const internal_comma2&) const; }; struct external_comma2 { }; -ret_with_comma2 operator BOOST_TT_TRAIT_OP (const external_comma2&, const external_comma2&); +ret_with_comma2 operator BOOST_TT_TRAIT_OP (const external_comma2&, const external_comma2&){ return ret_with_comma2(); } struct returns_int { int operator BOOST_TT_TRAIT_OP (const returns_int&); }; @@ -82,9 +82,9 @@ struct B : public A { }; struct C { }; struct D { }; -bool operator BOOST_TT_TRAIT_OP (const C&, void*) { return true; } -bool operator BOOST_TT_TRAIT_OP (void*, const D&) { return true; } -bool operator BOOST_TT_TRAIT_OP (const C&, const D&) { return true; } +inline bool operator BOOST_TT_TRAIT_OP (const C&, void*) { return true; } +inline bool operator BOOST_TT_TRAIT_OP (void*, const D&) { return true; } +inline bool operator BOOST_TT_TRAIT_OP (const C&, const D&) { return true; } //class internal_private { ret operator BOOST_TT_TRAIT_OP (const internal_private&) const; }; @@ -153,3 +153,4 @@ void common() { #endif #endif + diff --git a/test/has_postfix_operators.hpp b/test/has_postfix_operators.hpp index 3348ca5..c1a8f98 100644 --- a/test/has_postfix_operators.hpp +++ b/test/has_postfix_operators.hpp @@ -20,7 +20,7 @@ struct ret { }; struct internal { ret operator BOOST_TT_TRAIT_OP (int) const; }; struct external { }; -ret operator BOOST_TT_TRAIT_OP (const external&, int); +inline ret operator BOOST_TT_TRAIT_OP (const external&, int){ return ret(); } struct comma1_ret { }; struct ret_with_comma1 { comma1_ret operator,(int); }; @@ -28,14 +28,14 @@ struct ret_with_comma1 { comma1_ret operator,(int); }; struct internal_comma1 { ret_with_comma1 operator BOOST_TT_TRAIT_OP (int) const; }; struct external_comma1 { }; -ret_with_comma1 operator BOOST_TT_TRAIT_OP (const external_comma1&, int); +inline ret_with_comma1 operator BOOST_TT_TRAIT_OP (const external_comma1&, int){ return ret_with_comma1(); } struct ret_with_comma2 { void operator,(int); }; struct internal_comma2 { ret_with_comma2 operator BOOST_TT_TRAIT_OP (int) const; }; struct external_comma2 { }; -ret_with_comma2 operator BOOST_TT_TRAIT_OP (const external_comma2&, int); +inline ret_with_comma2 operator BOOST_TT_TRAIT_OP (const external_comma2&, int){ return ret_with_comma2(); } struct returns_int { int operator BOOST_TT_TRAIT_OP (int); }; @@ -56,14 +56,14 @@ struct returns_convertible_to_ret2 { convertible_to_ret2 operator BOOST_TT_TRAIT class Base1 { }; class Derived1 : public Base1 { }; -bool operator BOOST_TT_TRAIT_OP (const Base1&, int) { return true; } +inline bool operator BOOST_TT_TRAIT_OP (const Base1&, int) { return true; } class Base2 { }; struct Derived2 : public Base2 { Derived2(int); // to check if it works with a class that is not default constructible }; -bool operator BOOST_TT_TRAIT_OP (const Derived2&, int) { return true; } +inline bool operator BOOST_TT_TRAIT_OP (const Derived2&, int) { return true; } struct tag { }; @@ -129,3 +129,4 @@ void common() { } #endif + diff --git a/test/has_prefix_operators.hpp b/test/has_prefix_operators.hpp index dc87700..0c1d1ab 100644 --- a/test/has_prefix_operators.hpp +++ b/test/has_prefix_operators.hpp @@ -25,7 +25,7 @@ struct ret { }; struct internal { ret operator BOOST_TT_TRAIT_OP () const; }; struct external { }; -ret operator BOOST_TT_TRAIT_OP (const external&); +inline ret operator BOOST_TT_TRAIT_OP (const external&){ return ret(); } struct comma1_ret { }; struct ret_with_comma1 { comma1_ret operator,(int); }; @@ -33,14 +33,14 @@ struct ret_with_comma1 { comma1_ret operator,(int); }; struct internal_comma1 { ret_with_comma1 operator BOOST_TT_TRAIT_OP () const; }; struct external_comma1 { }; -ret_with_comma1 operator BOOST_TT_TRAIT_OP (const external_comma1&); +inline ret_with_comma1 operator BOOST_TT_TRAIT_OP (const external_comma1&){ return ret_with_comma1(); } struct ret_with_comma2 { void operator,(int); }; struct internal_comma2 { ret_with_comma2 operator BOOST_TT_TRAIT_OP () const; }; struct external_comma2 { }; -ret_with_comma2 operator BOOST_TT_TRAIT_OP (const external_comma2&); +inline ret_with_comma2 operator BOOST_TT_TRAIT_OP (const external_comma2&){ return ret_with_comma2(); } struct returns_int { int operator BOOST_TT_TRAIT_OP (); }; @@ -61,7 +61,7 @@ struct returns_convertible_to_ret2 { convertible_to_ret2 operator BOOST_TT_TRAIT class Base1 { }; class Derived1 : public Base1 { }; -bool operator BOOST_TT_TRAIT_OP (const Base1&) { return true; } +inline bool operator BOOST_TT_TRAIT_OP (const Base1&) { return true; } class Base2 { }; struct Derived2 : public Base2 { @@ -135,3 +135,4 @@ void common() { #endif #endif +