Created attachment 150764 [details] Fix math/qhull build with clang 3.5.0 The math/qhull port fails to compile with clang 3.5.0, due to the following error: In file included from /wrkdirs/usr/ports/math/qhull/work/qhull-2012.1/src/libqhullcpp/Coordinates.cpp:11: /wrkdirs/usr/ports/math/qhull/work/qhull-2012.1/src/libqhullcpp/Coordinates.h:154:22: error: reference to 'random_access_iterator_tag' is ambiguous typedef std::random_access_iterator_tag iterator_category; ^ /usr/include/c++/v1/iterator:354:30: note: candidate found by name lookup is 'std::__1::random_access_iterator_tag' struct _LIBCPP_TYPE_VIS_ONLY random_access_iterator_tag : public bidirectional_iterator_tag {}; ^ /wrkdirs/usr/ports/math/qhull/work/qhull-2012.1/src/libqhullcpp/QhullIterator.h:20:59: note: candidate found by name lookup is 'std::random_access_iterator_tag' namespace std { struct bidirectional_iterator_tag; struct random_access_iterator_tag; } ^ In file included from /wrkdirs/usr/ports/math/qhull/work/qhull-2012.1/src/libqhullcpp/Coordinates.cpp:11: /wrkdirs/usr/ports/math/qhull/work/qhull-2012.1/src/libqhullcpp/Coordinates.h:201:22: error: reference to 'random_access_iterator_tag' is ambiguous typedef std::random_access_iterator_tag iterator_category; ^ /usr/include/c++/v1/iterator:354:30: note: candidate found by name lookup is 'std::__1::random_access_iterator_tag' struct _LIBCPP_TYPE_VIS_ONLY random_access_iterator_tag : public bidirectional_iterator_tag {}; ^ /wrkdirs/usr/ports/math/qhull/work/qhull-2012.1/src/libqhullcpp/QhullIterator.h:20:59: note: candidate found by name lookup is 'std::random_access_iterator_tag' namespace std { struct bidirectional_iterator_tag; struct random_access_iterator_tag; } ^ 2 errors generated. This is because qhull tries to avoid including <iterator>, and rolls its own (incompatible) std::random_access_iterator_tag and std::bidrectional_iterator_tag. These are not full compatible with libc++'s own declarations, and clang 3.5.x has become more strict about matching them. The fix is to replace the hand-rolled declarations with #include <iterator> statements. This will work for any C++ standard library.
Auto-assigned to maintainer stephen@FreeBSD.org
A commit references this bug: Author: stephen Date: Fri Dec 19 14:59:11 UTC 2014 New revision: 374949 URL: https://svnweb.freebsd.org/changeset/ports/374949 Log: - Fix build error with clang 3.5.0. PR: 196127 Submitted by: Dimitry Andric <dim@FreeBSD.org> Changes: head/math/qhull/files/patch-src__libqhullcpp__QhullIterator.h head/math/qhull/files/patch-src__libqhullcpp__QhullLinkedList.h
This is brilliant! I had no idea how to fix this, and it would have taken me a while to track it down. Thank you very much. The fix is committed. Please get back to me if more changes are required.