diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index c881200d07f2..92344d30d3e1 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -2161,15 +2161,11 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, if (!OldMD->isVirtual()) continue; - if (!CheckOverridingFunctionReturnType(NewMD, OldMD)) { - // FIXME: Add OldMD to the list of methods NewMD overrides. - } - + if (!CheckOverridingFunctionReturnType(NewMD, OldMD)) + NewMD->addOverriddenMethod(OldMD); } } - } - } if (SC == FunctionDecl::Static && isa(NewFD) &&