[all-commits] [llvm/llvm-project] 782392: [clang-tidy] modernize-use-using work with multi-a...

mitchell-stellar via All-commits all-commits at lists.llvm.org
Fri Nov 15 13:10:39 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 782392db8122cafb5e0e4ad5fe0c24c46f11b2b7
      https://github.com/llvm/llvm-project/commit/782392db8122cafb5e0e4ad5fe0c24c46f11b2b7
  Author: Mitchell Balan <mitchell at stellarscience.com>
  Date:   2019-11-15 (Fri, 15 Nov 2019)

  Changed paths:
    M clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp
    M clang-tools-extra/test/clang-tidy/checkers/modernize-use-using.cpp

  Log Message:
  -----------
  [clang-tidy] modernize-use-using work with multi-argument templates

Summary:
If clang-tidy's modernize-use-using feature finds any commas that are not within parentheses, it won't create a fix. That means it won't change lines like:
  typedef std::pair<int, int> Point;
to
  using Point = std::pair<int, int>;
or even:
  typedef std::map<std::string, Foo> MyMap;
  typedef std::vector<int,MyCustomAllocator<int>> MyVector;

This patch allows the fix to apply to lines with commas if they are within parentheses or angle brackets that were not themselves within parentheses.

Reviewers: alexfh, hokein, aaron.ballman

Patch by: poelmanc

Subscribers: jonathanmeier, cfe-commits

Tags: #clang, #clang-tools-extra

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




More information about the All-commits mailing list