[PATCH] New warning for methods not marked 'override'
jordan_rose at apple.com
Fri Aug 2 17:49:55 PDT 2013
Comment at: lib/Sema/SemaDeclCXX.cpp:4248
@@ +4247,3 @@
+ // Also avoid issuing this diagnostic if not in C++11 mode.
+ if (getLangOpts().CPlusPlus11 && Record->hasOverrideAnnotation())
+ CheckMissingOverrideSpecifier(*this, *M);
David Blaikie wrote:
> Presumably we want to issue this in C++14, etc. So perhaps "not C++98"?
> & also - if you only need to test "hasOverrideAnnotation" here, why not just make it a free function, rather than having to spend a bit in the CXXRecordDecl's data? (I haven't looked in detail, but I assume that's what you're doing)
Our language modes are cumulative; C11 turns on the C99 flag. See LangStandards.def.
More information about the cfe-commits