timshen added a comment.

In http://reviews.llvm.org/D21243#455999, @alexfh wrote:

> Does this just fix the tests broken with http://reviews.llvm.org/D20498 or 
> have you looked at other checks that might be broken by 
> http://reviews.llvm.org/D20498, but don't have relevant tests?


This just fixes the tests broken by http://reviews.llvm.org/D20498. I didn't 
look at other patterns.

> Actually, the more interesting question is what patterns in the analyzed code 
> generate `ExprWithCleanups`?


A MaterializeTemporaryExpr now will always generate an ExprWithCleanups at 
full-expr entry. That is to say, there must be an ExprWithCleanups as an 
ancestor node of a MaterializeTemporaryExpr.

For example, the previous pattern:

  fooStmt(has(
    barExpr(
      hasDescendant(
        materializeTemporaryExpr()))))

should be changed to:

  fooStmt(has(
    exprWithCleanups(
      barExpr(
        hasDescendant(
          materializeTemporaryExpr())))

There are patterns around that are not explicitly checking for a 
MaterializeTemporaryExpr. If in the checked AST there is a 
MaterializeTemporaryExpr, an ignoringExprWithCleanups should be added to each 
of these patterns.

Does this help?


http://reviews.llvm.org/D21243



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to