[PATCH] D32743: [clang-tidy] Add new cert-dcl21-cpp check.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 8 05:33:02 PDT 2017


aaron.ballman added inline comments.


================
Comment at: test/clang-tidy/cert-dcl21-cpp.cpp:1
+// RUN: %check_clang_tidy %s cert-dcl21-cpp %t
+
----------------
alexfh wrote:
> As usual, please add tests with macros and templates with multiple instantiations. When diagnostics in macros are ignored, the tests should demonstrate this as well.
In addition to these tests, I'd like to see a test for the following:
```
struct S {};
typedef S& SRef;

SRef operator++(SRef, int);

struct T {
  typedef T& TRef;
  
  TRef operator++(int);
};

struct U {
  typedef const U& ConstURef;
  
  ConstURef& operator++(int); // There's an extra ref shoved on here for fun.
};

struct V {
  V *operator++(int);
  V *const operator--(int);
};
```


https://reviews.llvm.org/D32743





More information about the cfe-commits mailing list