[all-commits] [llvm/llvm-project] 24aafc: [clang-tidy] modernize-use-equals-default avoid ad...

mitchell-stellar via All-commits all-commits at lists.llvm.org
Wed Nov 20 15:13:17 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 24aafcadff3851ec3a0c42303fec63e815b19566
      https://github.com/llvm/llvm-project/commit/24aafcadff3851ec3a0c42303fec63e815b19566
  Author: Mitchell Balan <mitchell at stellarscience.com>
  Date:   2019-11-20 (Wed, 20 Nov 2019)

  Changed paths:
    M clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp
    M clang-tools-extra/clang-tidy/utils/LexerUtils.cpp
    M clang-tools-extra/clang-tidy/utils/LexerUtils.h
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/test/clang-tidy/checkers/modernize-use-equals-default-copy.cpp
    M clang-tools-extra/test/clang-tidy/checkers/modernize-use-equals-default.cpp

  Log Message:
  -----------
  [clang-tidy] modernize-use-equals-default avoid adding redundant semicolons

Summary:
`modernize-use-equals-default` replaces default constructors/destructors with `= default;`. When the optional semicolon after a member function is present, this results in two consecutive semicolons.

This patch checks to see if the next non-comment token after the code to be replaced is a semicolon, and if so offers a replacement of `= default` rather than `= default;`.

This patch adds trailing comments and semicolons to about 5 existing tests.

Reviewers: malcolm.parsons, angelgarcia, aaron.ballman, alexfh

Patch by: poelmanc

Subscribers: MyDeveloperDay, JonasToth, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D70144




More information about the All-commits mailing list