[PATCH] D103720: [clang] NFC: Rename rvalue to prvalue

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 8 16:38:10 PDT 2021


mizvekov marked an inline comment as done.
mizvekov added inline comments.


================
Comment at: clang/lib/Sema/SemaExprCXX.cpp:5662
   switch (ET) {
   case ET_IsLValueExpr: return E->isLValue();
+  case ET_IsRValueExpr:
----------------
rsmith wrote:
> Hm, I wonder if this it's correct that these both evaluate to false for an xvalue. Does anyone have a copy of Embarcadero's 32-bit compiler to test with?
I tested, looks correct:

```
#include <cstdio>

#define TEST(E) printf(#E " rvalue:%d lvalue:%d\n", __is_rvalue_expr(E), __is_lvalue_expr(E))

int main() {
  TEST(1);

  int x;
  TEST(x);
  TEST(static_cast<int&&>(x));

  struct T { int m; };
  TEST(T{}.m);

  return 0;
}
```
```
bcc32c test.cpp
.\test.exe
```
```
1 rvalue:1 lvalue:0
x rvalue:0 lvalue:1
static_cast<int&&>(x) rvalue:0 lvalue:0
T{}.m rvalue:0 lvalue:0
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103720



More information about the cfe-commits mailing list