diff --git a/test/RegressionTest/SmartPtrTest.h b/test/RegressionTest/SmartPtrTest.h index 7688801..0733ff1 100755 --- a/test/RegressionTest/SmartPtrTest.h +++ b/test/RegressionTest/SmartPtrTest.h @@ -19,6 +19,8 @@ #include "UnitTest.h" #include #include +#include + #if 0 // throw assert on failed test #define LOKI_assert(x) assert(x) @@ -28,6 +30,27 @@ using namespace Loki; +// friend injection +// see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28597 +class TestClass; +typedef SmartPtr Class; + +bool Compare( const Class& a, const Class& b ) +{ + return true; +} + +void friend_injection() +{ + std::vector vec; + std::sort( vec.begin(), vec.end(), Compare ); + std::nth_element( vec.begin(), vec.begin(), vec.end(), Compare ); + std::search( vec.begin(), vec.end(), + vec.begin(), vec.end(), Compare ); + Class a, b; + Compare( a, b ); +} + /////////////////////////////////////////////////////////////////////////////// // SmartPtrTest /////////////////////////////////////////////////////////////////////////////// @@ -63,6 +86,8 @@ public: return new TestClass(*this); } + + public: static int instances;