[PATCH] D38921: [analyzer] LoopUnrolling: update the matched assignment operators

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 1 05:31:46 PST 2017


aaron.ballman added a comment.

Aside from a request for another test, the matcher parts LGTM.



================
Comment at: unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp:1992
+  EXPECT_TRUE(matches("void x() { int a; a &= 3; }", AsOperator));
+  EXPECT_TRUE(notMatches("void x() { int a; if(a == 0) return; }", AsOperator));
+}
----------------
Can you also add a test like:
```
struct S { S& operator=(const S&); };
void x() { S s1, s2; s1 = s2; }
```


https://reviews.llvm.org/D38921





More information about the cfe-commits mailing list