[MacPorts] #54548: clang++-mp-4.0 and clang++-mp-5.0 fail where /usr/bin/clang++ and g++-mp-6 succeed

MacPorts noreply at macports.org
Sat Jul 29 21:22:41 UTC 2017


#54548: clang++-mp-4.0 and clang++-mp-5.0 fail where /usr/bin/clang++ and g++-mp-6
succeed
---------------------------------+------------------------
 Reporter:  MarcusCalhoun-Lopez  |      Owner:  jeremyhu@…
     Type:  defect               |     Status:  new
 Priority:  Normal               |  Milestone:
Component:  ports                |    Version:
 Keywords:                       |       Port:  clang-4.0
---------------------------------+------------------------
 In an attempt to fix #51046, I tried to build [https://github.com/macports
 /macports-ports/tree/master/graphics/vigra VIGRA] with a compiler from
 MacPorts.[[BR]]
 {{{macports-clang-4.0}}} and {{{macports-clang-5.0}}} failed but
 {{{macports-gcc-6}}} succeeded.[[BR]]
 Below is the smallest test case I could get it down to.[[BR]]
 {{{/usr/bin/clang++}}} and {{{g++-mp-6}}} compile it without
 complaint.[[BR]]
 {{{clang++-mp-4.0}}} and {{{clang++-mp-5.0}}} fail with the error:
 {{{
 test.cxx:35:5: error: no matching function for call to
 'gaussianDivergenceMultiArray'
     gaussianDivergenceMultiArray(array, res);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
 test.cxx:40:1: note: in instantiation of function template specialization
 'pythonGaussianDivergence<double, 2>' requested here
 pythonGaussianDivergence<double,2>(NumpyArray<2, TinyVector<double, 2> >
 array,
 ^
 test.cxx:13:1: note: candidate template ignored: could not match
 'MultiArrayView' against 'NumpyArray'
 gaussianDivergenceMultiArray(MultiArrayView<N, TinyVector<T1, N> > const &
 vectorField,
 ^
 1 error generated.
 }}}
 Since the Apple supplied {{{clang++}}} works, I am not sure whether this
 Trac or the [http://lists.llvm.org/mailman/listinfo/cfe-dev clang mailing
 list] is the more appropriate forum for discussion.[[BR]]
 Truth be told, I am no expert in template programming, so it is possible
 that the code '''should''' cause an error, in which case, it is VIGRA's
 problem.[[BR]]
 Test case:
 {{{
 template <unsigned N, class T>
 class MultiArrayView
 {
 };

 template <class T, int SIZE>
 class TinyVector
 {
 };

 template <unsigned N, class T1, class T2>
 inline void
 gaussianDivergenceMultiArray(MultiArrayView<N, TinyVector<T1, N> > const &
 vectorField,
                              MultiArrayView<N, T2> divergence)
 {
 }

 template<unsigned N, class T>
 struct NumpyArrayTraits
 {
     typedef T value_type;
 };

 template <unsigned N, class T>
 class NumpyArray
 : public MultiArrayView<N, typename NumpyArrayTraits<N, T>::value_type>
 {
 };

 template <class PixelType, unsigned N>
 void
 pythonGaussianDivergence(NumpyArray<N, TinyVector<PixelType, N> > array,
                          NumpyArray<N, double > res)
 {
     gaussianDivergenceMultiArray(array, res);
 }

 template
 void
 pythonGaussianDivergence<double,2>(NumpyArray<2, TinyVector<double, 2> >
 array,
                                    NumpyArray<2, double > res);
 }}}

--
Ticket URL: <https://trac.macports.org/ticket/54548>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list