Compiler Warning C4485
'override_function' : matches base ref class method 'base_class_function ', but is not marked 'new' or 'override'; 'new' (and 'virtual') is assumed
An accessor overrides, with or without the virtual
keyword, a base class accessor function, but the override
or new
specifier was not part of the overriding function signature. Add the new
or override
specifier to resolve this warning.
See override and new (new slot in vtable) for more information.
C4485 is always issued as an error. Use the warning pragma to suppress C4485.
Example
The following sample generates C4485
// C4485.cpp
// compile with: /clr
delegate void Del();
ref struct A {
virtual event Del ^E;
};
ref struct B : A {
virtual event Del ^E; // C4485
};
ref struct C : B {
virtual event Del ^E {
void raise() override {}
void add(Del ^) override {}
void remove(Del^) override {}
}
};
Athugasemdir
https://aka.ms/ContentUserFeedback.
Væntanlegt: Á árinu 2024 munum við hætta með GitHub-mál sem ábendingaleið fyrir efni og skipta því út fyrir nýtt ábendingakerfi. Frekari upplýsingar er að finna hér:Senda inn og skoða endurgjöf fyrir