[PATCH] New warning for methods not marked 'override'

Sam Panzer espanz at gmail.com
Fri Aug 2 14:06:00 PDT 2013


Add a warning for overridden methods that are missing the 'override' keyword. This diagnostic is only triggered when at least one method is marked 'override' in the class, and only in C++11 mode.

This way, codebase owners can be more confident when adding   'override' - it can be added one class at a time while asserting that methods are 'override' iff they override a base class's method.

http://llvm-reviews.chandlerc.com/D1275

Files:
  include/clang/AST/DeclCXX.h
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/AST/DeclCXX.cpp
  lib/Sema/SemaDeclCXX.cpp
  test/CXX/class.derived/class.virtual/p3-0x.cpp
  test/FixIt/fixit-cxx0x.cpp
  test/Misc/diag-override.cpp
  test/Parser/MicrosoftExtensions.cpp
  test/SemaCXX/cxx98-compat.cpp
  test/SemaCXX/ms-interface.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1275.1.patch
Type: text/x-patch
Size: 8883 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130802/dcbfcd0c/attachment.bin>


More information about the cfe-commits mailing list