You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2014/05/01 07:20:53 UTC

git commit: Fixed gcc-4.8 compilation error for stout interval set.

Repository: mesos
Updated Branches:
  refs/heads/master dbebd46f2 -> 81a63ee53


Fixed gcc-4.8 compilation error for stout interval set.

We are hitting the "Unqualified lookup in templates" issue in stout
interval set: http://clang.llvm.org/compatibility.html#dep_lookup

And looks like this is a boost bug:

1) boost/icl/concept/interval.hpp:621
  -- defines a template that uses 'lower_less_equal'

2) boost/icl/concept/interval.hpp:877
  -- 'lower_less_equal' is defined here

Since lower_less_equal does not contain any class type, the compiler may
or may not choose to reject the program according to the C++ standard :(
Clearly, gcc-4.8 rejects the program and gcc-4.4 does not.

I am using a workaround here to bypass the problem.

Review: https://reviews.apache.org/r/20935


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/81a63ee5
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/81a63ee5
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/81a63ee5

Branch: refs/heads/master
Commit: 81a63ee53932c2fc372b7ba0d881596cd44a2850
Parents: dbebd46
Author: Jie Yu <yu...@gmail.com>
Authored: Wed Apr 30 22:19:07 2014 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Apr 30 22:19:07 2014 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/stout/include/stout/interval.hpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/81a63ee5/3rdparty/libprocess/3rdparty/stout/include/stout/interval.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/interval.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/interval.hpp
index df01e13..c84e0c6 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/interval.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/interval.hpp
@@ -182,7 +182,11 @@ public:
   // Checks if an interval is in this set.
   bool contains(const Interval<T>& interval) const
   {
-    return boost::icl::contains(static_cast<const Base&>(*this), interval);
+    // TODO(jieyu): Boost has an issue regarding unqualified lookup in
+    // template (http://clang.llvm.org/compatibility.html#dep_lookup),
+    // and gcc-4.8 complains about it. We use a workaround here by
+    // delegating this call to the IntervalSet version below.
+    return contains(IntervalSet<T>(interval));
   }
 
   // Checks if an interval set is a subset of this set.