mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.38k stars 1.32k forks source link

Errors on -Wfinal-dtor-non-final-class warning (clang-10) #16342

Open springmeyer opened 4 years ago

springmeyer commented 4 years ago

The Clang 10.0.0 release has a new warning -Wfinal-dtor-non-final-class that causes compiler errors with gl-native (given the use of -Werror).

The errors are getting triggered on classes inside include/mbgl/style/layers/.

Turning off -Werror reveals them all:

Open to view:

[6/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/annotation/fill_annotation_impl.cpp.o In file included from ../../src/mbgl/annotation/fill_annotation_impl.cpp:4: ../../include/mbgl/style/layers/fill_layer.hpp:21:18: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~FillLayer() final; ^ ../../include/mbgl/style/layers/fill_layer.hpp:18:7: note: mark 'mbgl::style::FillLayer' as 'final' to silence this warning class FillLayer : public Layer { ^ 1 warning generated. [8/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/annotation/annotation_manager.cpp.o In file included from ../../src/mbgl/annotation/annotation_manager.cpp:10: ../../include/mbgl/style/layers/symbol_layer.hpp:23:20: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~SymbolLayer() final; ^ ../../include/mbgl/style/layers/symbol_layer.hpp:20:7: note: mark 'mbgl::style::SymbolLayer' as 'final' to silence this warning class SymbolLayer : public Layer { ^ 1 warning generated. [11/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/annotation/line_annotation_impl.cpp.o In file included from ../../src/mbgl/annotation/line_annotation_impl.cpp:4: ../../include/mbgl/style/layers/line_layer.hpp:24:18: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~LineLayer() final; ^ ../../include/mbgl/style/layers/line_layer.hpp:21:7: note: mark 'mbgl::style::LineLayer' as 'final' to silence this warning class LineLayer : public Layer { ^ 1 warning generated. [16/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/geometry/feature_index.cpp.o In file included from ../../src/mbgl/geometry/feature_index.cpp:3: In file included from ../../src/mbgl/renderer/layers/render_symbol_layer.hpp:6: In file included from ../../src/mbgl/style/layers/symbol_layer_impl.hpp:4: ../../include/mbgl/style/layers/symbol_layer.hpp:23:20: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~SymbolLayer() final; ^ ../../include/mbgl/style/layers/symbol_layer.hpp:20:7: note: mark 'mbgl::style::SymbolLayer' as 'final' to silence this warning class SymbolLayer : public Layer { ^ 1 warning generated. [18/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/layermanager/background_layer_factory.cpp.o In file included from ../../src/mbgl/layermanager/background_layer_factory.cpp:3: In file included from ../../src/mbgl/renderer/layers/render_background_layer.hpp:5: In file included from ../../src/mbgl/style/layers/background_layer_impl.hpp:4: ../../include/mbgl/style/layers/background_layer.hpp:21:24: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~BackgroundLayer() final; ^ ../../include/mbgl/style/layers/background_layer.hpp:18:7: note: mark 'mbgl::style::BackgroundLayer' as 'final' to silence this warning class BackgroundLayer : public Layer { ^ 1 warning generated. [20/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/layermanager/circle_layer_factory.cpp.o In file included from ../../src/mbgl/layermanager/circle_layer_factory.cpp:3: In file included from ../../src/mbgl/renderer/buckets/circle_bucket.hpp:9: In file included from ../../src/mbgl/programs/circle_program.hpp:7: In file included from ../../src/mbgl/style/layers/circle_layer_properties.hpp:9: ../../include/mbgl/style/layers/circle_layer.hpp:21:20: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~CircleLayer() final; ^ ../../include/mbgl/style/layers/circle_layer.hpp:18:7: note: mark 'mbgl::style::CircleLayer' as 'final' to silence this warning class CircleLayer : public Layer { ^ 1 warning generated. [21/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/layermanager/heatmap_layer_factory.cpp.o In file included from ../../src/mbgl/layermanager/heatmap_layer_factory.cpp:3: In file included from ../../src/mbgl/renderer/buckets/heatmap_bucket.hpp:9: In file included from ../../src/mbgl/programs/heatmap_program.hpp:8: In file included from ../../src/mbgl/style/layers/heatmap_layer_properties.hpp:9: ../../include/mbgl/style/layers/heatmap_layer.hpp:22:21: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~HeatmapLayer() final; ^ ../../include/mbgl/style/layers/heatmap_layer.hpp:19:7: note: mark 'mbgl::style::HeatmapLayer' as 'final' to silence this warning class HeatmapLayer : public Layer { ^ 1 warning generated. [22/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/layermanager/fill_extrusion_layer_factory.cpp.o In file included from ../../src/mbgl/layermanager/fill_extrusion_layer_factory.cpp:3: In file included from ../../src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp:8: In file included from ../../src/mbgl/programs/fill_extrusion_program.hpp:10: In file included from ../../src/mbgl/style/layers/fill_extrusion_layer_properties.hpp:9: ../../include/mbgl/style/layers/fill_extrusion_layer.hpp:21:27: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~FillExtrusionLayer() final; ^ ../../include/mbgl/style/layers/fill_extrusion_layer.hpp:18:7: note: mark 'mbgl::style::FillExtrusionLayer' as 'final' to silence this warning class FillExtrusionLayer : public Layer { ^ 1 warning generated. [23/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/layermanager/fill_layer_factory.cpp.o In file included from ../../src/mbgl/layermanager/fill_layer_factory.cpp:3: In file included from ../../src/mbgl/renderer/buckets/fill_bucket.hpp:8: In file included from ../../src/mbgl/programs/fill_program.hpp:10: In file included from ../../src/mbgl/style/layers/fill_layer_properties.hpp:9: ../../include/mbgl/style/layers/fill_layer.hpp:21:18: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~FillLayer() final; ^ ../../include/mbgl/style/layers/fill_layer.hpp:18:7: note: mark 'mbgl::style::FillLayer' as 'final' to silence this warning class FillLayer : public Layer { ^ 1 warning generated. [24/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/layermanager/hillshade_layer_factory.cpp.o In file included from ../../src/mbgl/layermanager/hillshade_layer_factory.cpp:3: In file included from ../../src/mbgl/renderer/layers/render_hillshade_layer.hpp:4: In file included from ../../src/mbgl/style/layers/hillshade_layer_impl.hpp:4: ../../include/mbgl/style/layers/hillshade_layer.hpp:21:23: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~HillshadeLayer() final; ^ ../../include/mbgl/style/layers/hillshade_layer.hpp:18:7: note: mark 'mbgl::style::HillshadeLayer' as 'final' to silence this warning class HillshadeLayer : public Layer { ^ 1 warning generated. [27/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/layermanager/raster_layer_factory.cpp.o In file included from ../../src/mbgl/layermanager/raster_layer_factory.cpp:3: In file included from ../../src/mbgl/renderer/layers/render_raster_layer.hpp:4: In file included from ../../src/mbgl/style/layers/raster_layer_impl.hpp:4: ../../include/mbgl/style/layers/raster_layer.hpp:21:20: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~RasterLayer() final; ^ ../../include/mbgl/style/layers/raster_layer.hpp:18:7: note: mark 'mbgl::style::RasterLayer' as 'final' to silence this warning class RasterLayer : public Layer { ^ 1 warning generated. [30/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/layermanager/line_layer_factory.cpp.o In file included from ../../src/mbgl/layermanager/line_layer_factory.cpp:3: In file included from ../../src/mbgl/renderer/buckets/line_bucket.hpp:7: In file included from ../../src/mbgl/programs/line_program.hpp:8: In file included from ../../src/mbgl/renderer/layers/render_line_layer.hpp:4: In file included from ../../src/mbgl/style/layers/line_layer_impl.hpp:4: ../../include/mbgl/style/layers/line_layer.hpp:24:18: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~LineLayer() final; ^ ../../include/mbgl/style/layers/line_layer.hpp:21:7: note: mark 'mbgl::style::LineLayer' as 'final' to silence this warning class LineLayer : public Layer { ^ 1 warning generated. [31/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/layermanager/symbol_layer_factory.cpp.o In file included from ../../src/mbgl/layermanager/symbol_layer_factory.cpp:3: In file included from ../../src/mbgl/layout/symbol_layout.hpp:5: In file included from ../../src/mbgl/style/layers/symbol_layer_properties.hpp:9: ../../include/mbgl/style/layers/symbol_layer.hpp:23:20: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~SymbolLayer() final; ^ ../../include/mbgl/style/layers/symbol_layer.hpp:20:7: note: mark 'mbgl::style::SymbolLayer' as 'final' to silence this warning class SymbolLayer : public Layer { ^ 1 warning generated. [32/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/layout/symbol_instance.cpp.o In file included from ../../src/mbgl/layout/symbol_instance.cpp:1: In file included from ../../src/mbgl/layout/symbol_instance.hpp:3: In file included from ../../src/mbgl/text/quads.hpp:4: In file included from ../../src/mbgl/style/layers/symbol_layer_properties.hpp:9: ../../include/mbgl/style/layers/symbol_layer.hpp:23:20: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~SymbolLayer() final; ^ ../../include/mbgl/style/layers/symbol_layer.hpp:20:7: note: mark 'mbgl::style::SymbolLayer' as 'final' to silence this warning class SymbolLayer : public Layer { ^ 1 warning generated. [33/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/layout/symbol_projection.cpp.o In file included from ../../src/mbgl/layout/symbol_projection.cpp:1: In file included from ../../src/mbgl/layout/symbol_projection.hpp:5: In file included from ../../src/mbgl/programs/symbol_program.hpp:13: In file included from ../../src/mbgl/style/layers/symbol_layer_properties.hpp:9: ../../include/mbgl/style/layers/symbol_layer.hpp:23:20: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~SymbolLayer() final; ^ ../../include/mbgl/style/layers/symbol_layer.hpp:20:7: note: mark 'mbgl::style::SymbolLayer' as 'final' to silence this warning class SymbolLayer : public Layer { ^ 1 warning generated. [36/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/map/map.cpp.o In file included from ../../src/mbgl/map/map.cpp:5: ../../src/mbgl/map/map_impl.hpp:32:13: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~Impl() final; ^ ../../src/mbgl/map/map_impl.hpp:29:12: note: mark 'mbgl::Map::Impl' as 'final' to silence this warning class Map::Impl : public style::Observer, public RendererObserver { ^ 1 warning generated. [38/329] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/map/map_impl.cpp.o In file included from ../../src/mbgl/map/map_impl.cpp:2: ../../src/mbgl/map/map_impl.hpp:32:13: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class] ~Impl() final; ^ ../../src/mbgl/map/map_impl.hpp:29:12: note: mark 'mbgl::Map::Impl' as 'final' to silence this warning class Map::Impl : public style::Observer, public RendererObserver { ^ 1 warning generated.
springmeyer commented 4 years ago

@tmpsantos no rush, but I'm curious if you think this will be fixed by #16379?

tmpsantos commented 4 years ago

@tmpsantos no rush, but I'm curious if you think this will be fixed by #16379?

Yes, that branch will build with clang-10 with no issues.