summaryrefslogtreecommitdiff
path: root/src/base/refcnt.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2011-01-03 15:31:20 -0500
committerGabe Black <gblack@eecs.umich.edu>2011-01-03 15:31:20 -0500
commit1a10ccc5e551857fc3a7c049df99547ccfe3f72b (patch)
treed01634f8964a75d310067a365d857284eee7aba5 /src/base/refcnt.hh
parent5e25f317125ee8311702831f7b7a99cd19172293 (diff)
downloadgem5-1a10ccc5e551857fc3a7c049df99547ccfe3f72b.tar.xz
RefCount: Fix reference counting pointer == and != with a T* on the left.
These operators were expecting a const T& instead of a const T*, and were not being picked up and used by gcc in the right places as a result. Apparently no one used these operators before. A unit test which exposed these problems, verified the solution, and checks other basic functionality is on the way.
Diffstat (limited to 'src/base/refcnt.hh')
-rw-r--r--src/base/refcnt.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/base/refcnt.hh b/src/base/refcnt.hh
index 64224ca7f..b73183a1a 100644
--- a/src/base/refcnt.hh
+++ b/src/base/refcnt.hh
@@ -109,7 +109,7 @@ bool operator==(const RefCountingPtr<T> &l, const T *r)
{ return l.get() == r; }
template<class T>
-bool operator==(const T &l, const RefCountingPtr<T> &r)
+bool operator==(const T *l, const RefCountingPtr<T> &r)
{ return l == r.get(); }
template<class T>
@@ -121,7 +121,7 @@ bool operator!=(const RefCountingPtr<T> &l, const T *r)
{ return l.get() != r; }
template<class T>
-bool operator!=(const T &l, const RefCountingPtr<T> &r)
+bool operator!=(const T *l, const RefCountingPtr<T> &r)
{ return l != r.get(); }
#endif // __BASE_REFCNT_HH__