id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 462,Geos does not compile with clang (LLVM) [GeometryFactory.h errors],vince,pramsey,"Apparently, g++ does not object to implicit conversions from geos::geom::GeometryCollection * (or other geometry types) to std::auto_ptr, but clang raises an error: {{{ libtool: compile: /Developer/usr/bin/clang++ -DHAVE_CONFIG_H -I. -I../../include -I../../include/geos -I../../include -I/usr/pkg/include -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long -pipe -O2 -arch x86_64 -MT ConvexHull.lo -MD -MP -MF .deps/ConvexHull.Tpo -c ConvexHull.cpp -fno-common -DPIC -o .libs/ConvexHull.o In file included from ConvexHull.cpp:23: ../../include/geos/geom/GeometryFactory.h:323:14: error: no matching conversion for functional-style cast from 'geos::geom::GeometryCollection *' to 'std::auto_ptr' return std::auto_ptr( createGeometryCollection() ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/4.2.1/memory:189:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::GeometryCollection *' to 'element_type *' (aka 'geos::geom::Geometry *') auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { } ^ /usr/include/c++/4.2.1/memory:198:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::GeometryCollection *' to 'std::auto_ptr &' auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { } ^ /usr/include/c++/4.2.1/memory:348:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::GeometryCollection *' to 'auto_ptr_ref' auto_ptr(auto_ptr_ref __ref) throw() ^ /usr/include/c++/4.2.1/memory:211:9: note: candidate template ignored: failed template argument deduction auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { } ^ In file included from ConvexHull.cpp:23: ../../include/geos/geom/GeometryFactory.h:346:14: error: no matching conversion for functional-style cast from 'geos::geom::GeometryCollection *' to 'std::auto_ptr' return std::auto_ptr( createGeometryCollection(fromGeoms) ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/4.2.1/memory:189:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::GeometryCollection *' to 'element_type *' (aka 'geos::geom::Geometry *') auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { } ^ /usr/include/c++/4.2.1/memory:198:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::GeometryCollection *' to 'std::auto_ptr &' auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { } ^ /usr/include/c++/4.2.1/memory:348:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::GeometryCollection *' to 'auto_ptr_ref' auto_ptr(auto_ptr_ref __ref) throw() ^ /usr/include/c++/4.2.1/memory:211:9: note: candidate template ignored: failed template argument deduction auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { } ^ In file included from ConvexHull.cpp:23: ../../include/geos/geom/GeometryFactory.h:351:14: error: no matching conversion for functional-style cast from 'geos::geom::MultiPolygon *' to 'std::auto_ptr' return std::auto_ptr( createMultiPolygon(fromGeoms) ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/4.2.1/memory:189:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::MultiPolygon *' to 'element_type *' (aka 'geos::geom::Geometry *') auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { } ^ /usr/include/c++/4.2.1/memory:198:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::MultiPolygon *' to 'std::auto_ptr &' auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { } ^ /usr/include/c++/4.2.1/memory:348:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::MultiPolygon *' to 'auto_ptr_ref' auto_ptr(auto_ptr_ref __ref) throw() ^ /usr/include/c++/4.2.1/memory:211:9: note: candidate template ignored: failed template argument deduction auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { } ^ In file included from ConvexHull.cpp:23: ../../include/geos/geom/GeometryFactory.h:353:14: error: no matching conversion for functional-style cast from 'geos::geom::MultiLineString *' to 'std::auto_ptr' return std::auto_ptr( createMultiLineString(fromGeoms) ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/4.2.1/memory:189:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::MultiLineString *' to 'element_type *' (aka 'geos::geom::Geometry *') auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { } ^ /usr/include/c++/4.2.1/memory:198:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::MultiLineString *' to 'std::auto_ptr &' auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { } ^ /usr/include/c++/4.2.1/memory:348:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::MultiLineString *' to 'auto_ptr_ref' auto_ptr(auto_ptr_ref __ref) throw() ^ /usr/include/c++/4.2.1/memory:211:9: note: candidate template ignored: failed template argument deduction auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { } ^ In file included from ConvexHull.cpp:23: ../../include/geos/geom/GeometryFactory.h:355:14: error: no matching conversion for functional-style cast from 'geos::geom::MultiPoint *' to 'std::auto_ptr' return std::auto_ptr( createMultiPoint(fromGeoms) ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/4.2.1/memory:189:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::MultiPoint *' to 'element_type *' (aka 'geos::geom::Geometry *') auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { } ^ /usr/include/c++/4.2.1/memory:198:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::MultiPoint *' to 'std::auto_ptr &' auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { } ^ /usr/include/c++/4.2.1/memory:348:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'geos::geom::MultiPoint *' to 'auto_ptr_ref' auto_ptr(auto_ptr_ref __ref) throw() ^ /usr/include/c++/4.2.1/memory:211:9: note: candidate template ignored: failed template argument deduction auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { } ^ }}} It might be necessary to insert dynamic or static casts.",defect,closed,major,3.3.1,Build/Install,3.3.0,Critical,duplicate,clang casts GeometryFactory,