[PATCH] D18919: [Clang-tidy] Add check "modernize use using"

Marek Kurdej via cfe-commits cfe-commits at lists.llvm.org
Tue May 3 07:46:15 PDT 2016


curdeius added a subscriber: curdeius.
curdeius added a comment.

I'm really interested in the manner this check works when a typedef has multiple declarations in it (same example as in the comment):

  typedef int m_int, *m_int_p, &m_int_r, m_int_arr[10], (&m_int_fun)(int, int);

I tried to implement such a check once, but this was the hard part. FYI, that's my stub: https://github.com/llvm-mirror/clang-tools-extra/compare/master...mkurdej:feature/use-using.


================
Comment at: docs/clang-tidy/checks/modernize-use-using.rst:21
@@ +20,3 @@
+
+  using varible = int;
+
----------------
Typo: varible -> variable.

================
Comment at: test/clang-tidy/modernize-use-using.cpp:1
@@ +1,2 @@
+// RUN: %check_clang_tidy %s modernize-use-using %t
+
----------------
Could you add tests for the case where there are multiple type declarations in one statement? E.g.:

```
typedef int m_int, *m_int_p, &m_int_r, m_int_arr[10], (&m_int_fun)(int, int);
```

Would it be transformed to multiple using statements or only a warning will be emitted?


Repository:
  rL LLVM

http://reviews.llvm.org/D18919





More information about the cfe-commits mailing list