| Issue |
63801
|
| Summary |
Incorrect warning from -Woverloaded-virtual for class with multiple inheritance
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
mortior
|
This code has been tested both with clang-14 bundled with Ubuntu 22.04 and clang from the main branch in git at 2023-07-01.
If the code below is compiled with `-Woverloaded-virtual`, the compiler issues a warning that 'D::f' hides an overloaded virtual function even though the only visible `f` function in `B` is the one overloaded in `D` and `C` has no visible `f`.
In the case where `D` only inherits from `B` there is no warning, as expected.
command line to reproduce: `clang++ -Woverloaded-virtual test.cpp`
```
class A
{
public:
virtual ~A();
virtual int f(int);
};
class B : public A
{
public:
~B() override;
virtual int f(int, int);
private:
using A::f;
};
class C : public virtual A
{
public:
~C() override;
private:
using A::f;
};
class D : public B, public C
{
public:
~D() override;
int f(int, int) override;
};
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs