[PATCH] D98971: [C++20] [P1825] Fix bugs with implicit-move from variables of reference type

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 19 11:51:17 PDT 2021


mizvekov added inline comments.


================
Comment at: clang/lib/Sema/SemaStmt.cpp:3095
 
-  // ...non-volatile...
-  if (VD->getType().isVolatileQualified())
-    return false;
-
-  // C++20 [class.copy.elision]p3:
-  // ...rvalue reference to a non-volatile...
-  if (VD->getType()->isRValueReferenceType() &&
-      (!(CESK & CES_AllowRValueReferenceType) ||
-       VD->getType().getNonReferenceType().isVolatileQualified()))
+  if (VD->getType()->isObjectType()) {
+    // C++17 [class.copy.elision]p3:
----------------
A drive by fix here would be that we already have a VDType in this context, might as well use it even though original for some reason missed it in this part.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98971



More information about the cfe-commits mailing list