On Wed, May 31, 2017 at 5:49 PM, Ian Romanick <i...@freedesktop.org> wrote: > On 05/31/2017 06:09 AM, Emil Velikov wrote: >> On 31 May 2017 at 01:55, Ian Romanick <i...@freedesktop.org> wrote: >>> I don't understand these warnings, and I have even less understanding of >>> how "using" fixes them. For example... >>> >>> On 05/30/2017 01:47 PM, Rob Herring wrote: >>>> clang gives warnings about overloaded virtual functions: >>>> >>>> src/compiler/glsl/linker.cpp:244:30: warning: '(anonymous >>>> namespace)::array_resize_visitor::visit' hides overloaded virtual function >>>> [-Woverloaded-virtual] >>>> virtual ir_visitor_status visit(ir_variable *var) >>>> ^ >>>> src/compiler/glsl/linker.cpp:195:30: note: hidden overloaded virtual >>>> function '(anonymous namespace)::deref_type_updater::visit' declared here: >>>> type mismatch at 1st parameter ('ir_dereference_variable *' vs >>>> 'ir_variable *') >>>> virtual ir_visitor_status visit(ir_dereference_variable *ir) >>>> ^ >>> >>> This is weird and confusing. ir_hierarchical_visitor has a virtual >>> visit(class ir_dereference_variable *) method. The complaint about the >>> type seems... bizarre. >>> >> Since it took me a second to click here is my take on it: >> >> The "base" class deref_type_updater has >> virtual ir_visitor_status visit(ir_variable *var) >> >> ... while the derived one class array_resize_visitor >> virtual ir_visitor_status visit(ir_dereference_variable *ir) >> >> ... hence the type mismatch. > > Right... but deref_type_updater is derived from ir_hierarchical_visitor, > and that has virtual ir_visitor_status visit(ir_dereference_variable > *ir). That is the function being overridden.
The problem AIUI is specific to overloaded functions. Here deref_type_updater::visit overrides all the ir_hierarchical_visitor::visit functions, so they are not available to array_resize_visitor by default. Rob _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev