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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed May 4 11:46:09 PDT 2016


On Wed, May 4, 2016 at 2:41 PM, Piotr Padlewski via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
> Prazek added a comment.
>
> In http://reviews.llvm.org/D18919#419902, @curdeius wrote:
>
>> 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.
>
>
> I don't think that this featcher is necessary. I don't know a lot of code using it. I am curious how this check will behave.

FWIW, this is a very common pattern in Win32 headers. You most often see it as:

typedef struct _THING {
  // members
} THING, *LPTHING;

You'll also see:

typedef THING THING32, *LPTHING32;

~Aaron


More information about the cfe-commits mailing list