[Lldb-commits] [lldb] r199505 - Avoid the gcc warning -Wno-non-template-friend
Steve Pucci
spucci at google.com
Fri Jan 17 10:25:25 PST 2014
Author: spucci
Date: Fri Jan 17 12:25:25 2014
New Revision: 199505
URL: http://llvm.org/viewvc/llvm-project?rev=199505&view=rev
Log:
Avoid the gcc warning -Wno-non-template-friend
To avoid this warning, friend declarations inside template classes
must be declared as templates:
http://stackoverflow.com/questions/4039817/friend-declaration-declares-a-non-template-function
Modified:
lldb/trunk/include/lldb/Utility/Iterable.h
Modified: lldb/trunk/include/lldb/Utility/Iterable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/Iterable.h?rev=199505&r1=199504&r2=199505&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Utility/Iterable.h (original)
+++ lldb/trunk/include/lldb/Utility/Iterable.h Fri Jan 17 12:25:25 2014
@@ -147,9 +147,14 @@ public:
return m_iter >= rhs.m_iter;
}
- friend AdaptedConstIterator operator+(typename BackingIterator::difference_type, AdaptedConstIterator &);
- friend typename BackingIterator::difference_type operator-(AdaptedConstIterator &, AdaptedConstIterator &);
- friend void swap(AdaptedConstIterator &, AdaptedConstIterator &);
+ template <typename C1, typename E1, E1 (*A1)(typename C1::const_iterator &)>
+ friend AdaptedConstIterator<C1, E1, A1> operator+(typename C1::const_iterator::difference_type, AdaptedConstIterator<C1, E1, A1> &);
+
+ template <typename C1, typename E1, E1 (*A1)(typename C1::const_iterator &)>
+ friend typename C1::const_iterator::difference_type operator-(AdaptedConstIterator<C1, E1, A1> &, AdaptedConstIterator<C1, E1, A1> &);
+
+ template <typename C1, typename E1, E1 (*A1)(typename C1::const_iterator &)>
+ friend void swap(AdaptedConstIterator<C1, E1, A1> &, AdaptedConstIterator<C1, E1, A1> &);
};
template <typename C, typename E, E (*A)(typename C::const_iterator &)>
More information about the lldb-commits
mailing list