You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Implicit move before taking address of member #558
//=== Cpp2 type declarations ====================================================
#include"cpp2util.h"classt;
//=== Cpp2 type definitions and function declarations ===========================classt {
public: cpp2::i32 x;
};
automain() -> int;
//=== Cpp2 function definitions =================================================automain() -> int{
t v {};
(void) &std::move(v).x;
}
Note that you could say that this is fixed by appending the statement _ = v;.
IIRC there have been exceptions added to not generate a move on last use
in a case like the one in this issue, e.g., moving is statically known to be always ill-formed.
Which is why I opened this issue instead.
Activity
JohelEGP commentedon Aug 29, 2023
Note that you could say that this is fixed by appending the statement
_ = v;.IIRC there have been exceptions added to not generate a move on last use
in a case like the one in this issue, e.g., moving is statically known to be always ill-formed.
Which is why I opened this issue instead.
JohelEGP commentedon Sep 12, 2023
This is what I'm referring to:
cppfront/source/cppfront.cpp
Lines 3100 to 3109 in ecd3726
It works for variables, but not when accessing a variable's data member.