зеркало из https://github.com/microsoft/clang.git
-Woverloaded-virtual shouldn't warn for static functions. Fixes rdar://9083431 & http://llvm.org/PR9396.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126966 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
b46ae3964b
Коммит
0266aa3780
|
@ -2838,6 +2838,7 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) {
|
|||
for (CXXRecordDecl::method_iterator M = Record->method_begin(),
|
||||
MEnd = Record->method_end();
|
||||
M != MEnd; ++M) {
|
||||
if (!(*M)->isStatic())
|
||||
DiagnoseHiddenVirtualMethods(Record, *M);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,3 +52,15 @@ struct Derived : public Base {
|
|||
void foo(int, int);
|
||||
};
|
||||
}
|
||||
|
||||
namespace PR9396 {
|
||||
class A {
|
||||
public:
|
||||
virtual void f(int) {}
|
||||
};
|
||||
|
||||
class B : public A {
|
||||
public:
|
||||
static void f() {}
|
||||
};
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче