[PATCH] D23008: [clang-tidy] fix segfault in cppcore-guidelines-special-member-functions check

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 2 13:02:03 PDT 2016


aaron.ballman added inline comments.

================
Comment at: clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp:63-64
@@ -62,4 +62,4 @@
 
-std::string SpecialMemberFunctionsCheck::join(
-    llvm::ArrayRef<SpecialMemberFunctionKind> SMFS, llvm::StringRef AndOr) {
+template <typename R>
+static std::string join(const R &SMFS, llvm::StringRef AndOr) {
 
----------------
jbcoe wrote:
> aaron.ballman wrote:
> > I hadn't noticed this before -- why has this been converted to an unrestricted template? If generality is what you were going for, it should have accepted a range (or a pair of iterators) instead?
> It needs to handle SmallSetVector which I can't convert to an ArrayRef.
> 
> How do I specify a range?
```
template <typename Iter>
static std::string join(llvm::iterator_range<Iter> R, llvm::StringRef AndOr);
```
Untested, but you get the idea.


https://reviews.llvm.org/D23008





More information about the cfe-commits mailing list