[PATCH] D30610: [clang-tidy] Added options to cppcoreguidelines-special-member-functions check

Florian Gross via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 4 09:23:08 PST 2017


fgross created this revision.
Herald added subscribers: JDevlieghere, nemanjai.

Added two options to cppcoreguidelines-special-member-functions to allow a more relaxed checking.

With 'AllowSoleDefaultDtor' set to 1, classes with explicitly defaulted destructors but no other special members are not flagged anymore:

  class foo {
   // typical scenario: defaulted virtual destructor in base classes
    virtual ~foo() = default;
  };

With 'AllowMissingMoveFunctions' set to 1, classes with no move functions at all are not flagged anymore:

  class bar{
   ~bar();
   bar(const bar&);
   bar& operator=(const bar&);
  };


https://reviews.llvm.org/D30610

Files:
  clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp
  clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h
  test/clang-tidy/cppcoreguidelines-special-member-functions-cxx-03.cpp
  test/clang-tidy/cppcoreguidelines-special-member-functions-relaxed.cpp
  test/clang-tidy/cppcoreguidelines-special-member-functions.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30610.90585.patch
Type: text/x-patch
Size: 14910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170304/c9e99572/attachment.bin>


More information about the cfe-commits mailing list