[QGIS-Developer] Help fixing code for gcc 4.8

Alessandro Pasotti apasotti at gmail.com
Wed May 22 08:40:45 PDT 2019


Hi Henrik,

Try to replace {} with (), such as:

const auto treeLayer ( static_cast<const QgsLayerTreeLayer *>( childNode )
);



On Wed, May 22, 2019 at 4:42 PM Henrik Krohns <hege at hege.li> wrote:

>
> Hello,
>
> I've been trying to compile QGis on RHEL7 / GCC 4.8.5 all day.  It seems
> lots of code assume newer compiler.  I've fixed many cases already, but
> here's something I can't manage..  not really proficient in C++..
>
> src/server/services/wms/qgswmsgetcapabilities.cpp: In function 'bool
> QgsWms::hasQueryableChildren(const QgsLayerTreeNode*, const QStringList&)':
> src/server/services/wms/qgswmsgetcapabilities.cpp:1893:31: error: base
> operand of '->' has non-pointer type 'const std::initializer_list<const
> QgsLayerTreeLayer* const>'
>        const auto l { treeLayer->layer() };
>                                ^
> src/server/services/wms/qgswmsgetcapabilities.cpp:1893:41: error: unable
> to deduce 'const std::initializer_list<const auto>' from '{<expression
> error>}'
>        const auto l { treeLayer->layer() };
>
> The code..
>
>     else if ( childNode->nodeType() == QgsLayerTreeNode::NodeLayer )
>     {
>       const auto treeLayer { static_cast<const QgsLayerTreeLayer *>(
> childNode ) };
>       const auto l { treeLayer->layer() };
>       return ! wmsRestrictedLayers.contains( l->name() ) &&
> l->flags().testFlag( QgsMapLayer::Identifiable );
>
> Any ideas how to rewrite?
>
> Cheers,
> Henrik
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer



-- 
Alessandro Pasotti
w3:   www.itopen.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190522/8e5fb8e4/attachment.html>


More information about the QGIS-Developer mailing list