[PATCH] D23257: Fix clang-tidy crash when a single fix is applied on multiple files.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 8 09:13:32 PDT 2016


alexfh added inline comments.

================
Comment at: test/clang-tidy/Inputs/modernize-pass-by-value/header-with-fix.h:1
@@ +1,2 @@
+#include <string>
+
----------------
hokein wrote:
> Usually test should not use STL headers as it relies on the system headers.
> 
> You don't have to use std::string to reproduce the crash, IMO.
Yep, just a class with a user-defined move constructor should be fine.

```
// .h file:
struct S {
  S(S&&);
  S(const S&);
};
struct Foo {
  Foo(const S &s);
  S s;
};

// .cpp file:
#include "a.h"
Foo::Foo(const S &s) : s(s) {}
```


https://reviews.llvm.org/D23257





More information about the cfe-commits mailing list