alexfh added inline comments.

================
Comment at: clang-tidy/misc/InefficientAlgorithmCheck.cpp:114-118
@@ +113,7 @@
+
+  if (SM.isMacroArgExpansion(CallRange.getBegin()) &&
+      SM.isMacroArgExpansion(CallRange.getEnd())) {
+    CallRange.setBegin(SM.getSpellingLoc(CallRange.getBegin()));
+    CallRange.setEnd(SM.getSpellingLoc(CallRange.getEnd()));
+  }
+
----------------
klimek wrote:
> Any reason we don't want to use Lexer::makeFileCharRange here (which should 
> handle all the cases correctly).
It was the first thing I tried, but it gets the test case wrong, i.e. it 
replaces the whole macro invocation instead of just the argument:

```
#define SECOND(x, y, z) y
  SECOND(q,std::count(s.begin(), s.end(), 22),w);
```

becomes

```
#define SECOND(x, y, z) y
  s.count(22);
```


http://reviews.llvm.org/D11677




_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to