================
@@ -316,10 +316,15 @@ class TrivialFunctionAnalysisVisitor
 
     if (UO->isIncrementOp() || UO->isDecrementOp()) {
       // Allow increment or decrement of a POD type.
-      if (auto *RefExpr = dyn_cast<DeclRefExpr>(UO->getSubExpr())) {
+      auto *SubExpr = UO->getSubExpr();
+      if (auto *RefExpr = dyn_cast<DeclRefExpr>(SubExpr)) {
----------------
rniwa wrote:

oh, that's a good point. I guess we can rely on `Visit` call on `SubExpr` 
instead of checking that it's a POD type. Actually, we can just allow any unary 
operator so long as its subexpression is trivial just as we do for binary 
operators.

https://github.com/llvm/llvm-project/pull/91102
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to