[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 17 20:37:46 PDT 2022


ChuanqiXu added a comment.

I've looked into the details as much as I can and I don't find explicit errors.

---

It is better to add tests in clang/unittest by using `VarDecl::isNRVOVariable()`.



================
Comment at: clang/include/clang/Sema/Scope.h:533-535
+    if (NRVO.getPointer() != nullptr && NRVO.getPointer() != NewNRVO)
+      NRVO.setInt(true);
+    NRVO.setPointer(NewNRVO);
----------------

The suggested changes smell better.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119792/new/

https://reviews.llvm.org/D119792



More information about the cfe-commits mailing list