Snape3058 wrote: My idea is to just keep my current matcher (DeclStmt -> VarDecl -> ImpCast (L2R) -> DeclRefExpr), which will ignore all C++ constructor invocations, and exclude the C++ ref types from the matcher only, which makes the UndefinedAssignmentChecker report for ref type self-assignments. The reasons are that constructor calls are evaluated before the assignment, so if there are copy ctor calls, ignoring the bind here makes fewer differences. Besides, it seems that in the case of copy ctor calls, the UndefinedAssignmentChecker::checkBind checker will not be hit (according to my tests with @steakhal 's example https://godbolt.org/z/jPEa4sfeM above).
https://github.com/llvm/llvm-project/pull/187530 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
