Clang has a warning about overloading virtuals that triggers when a
derived class defines a virtual function that's an overload of
function in the base class. This kind of thing:
struct chart; // let's pretend this exists
struct Base
{
virtual void* get(char* e);
};
struct Derived: public Base {
virtual void* get(chart* e); // typo, we wanted to override the same function
};
The solution is to use
using Base::get;
to be explicit about the intention to reuse the base class virtual.
We hit this a lot with out glsl ir_hierarchical_visitor visitor
pattern, so let's adds some 'using' to calm down the compiler.
See-also: https://stackoverflow.com/questions/
18515183/c-overloaded-virtual-function-warning-by-clang)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3686>
class array_resize_visitor : public deref_type_updater {
public:
+ using deref_type_updater::visit;
+
unsigned num_vertices;
gl_shader_program *prog;
gl_shader_stage stage;
*/
class array_sizing_visitor : public deref_type_updater {
public:
+ using deref_type_updater::visit;
+
array_sizing_visitor()
: mem_ctx(ralloc_context(NULL)),
unnamed_interfaces(_mesa_pointer_hash_table_create(NULL))
* contains the jump.
*/
+ using ir_control_flow_visitor::visit;
+
bool progress;
struct function_record function;
class ir_constant_variable_visitor : public ir_hierarchical_visitor {
public:
+ using ir_hierarchical_visitor::visit;
+ using ir_hierarchical_visitor::visit_enter;
+
virtual ir_visitor_status visit_enter(ir_dereference_variable *);
virtual ir_visitor_status visit(ir_variable *);
virtual ir_visitor_status visit_enter(ir_assignment *);
class kill_for_derefs_visitor : public ir_hierarchical_visitor {
public:
+ using ir_hierarchical_visitor::visit;
+
kill_for_derefs_visitor(exec_list *assignments)
{
this->assignments = assignments;