================
@@ -570,3 +570,19 @@ struct PR52818 {
int bar;
};
+
+struct RefReassignment {
+ RefReassignment(int &i) : m_i{i} {
+ m_i = 1;
+ }
+ int & m_i;
+};
+
+struct ReassignmentAfterUnsafetyAssignment {
+ ReassignmentAfterUnsafetyAssignment() {
+ int a = 10;
+ m_i = a;
+ m_i = 1;
+ }
+ int m_i;
+};
----------------
HerrCai0907 wrote:
positive tests still have some issue. It will report for each assignments. But
I don't find a good solution to handle this case. It's already marked in
`isSafeAssignment`.
```c++
// TODO: Probably should guard against function calls that could have side
// effects or if they do reference another field that's initialized before this
// field, but is modified before the assignment.
```
https://github.com/llvm/llvm-project/pull/70316
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits