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
Command lines including which C++ compiler you are using
clanf 14, macos
FetchContent_Declare(
cppfront
GIT_REPOSITORY https://github.com/modern-cmake/cppfront.git
GIT_TAG main # or an actual git SHA if you don't like to live dangerously
)
FetchContent_MakeAvailable(cppfront)
Expected result - what you expected to happen
error, can not move already moved var.
|Error can not reassign moved var
Error can not cout already moved var
Actual result/error
no error - that is the problem
Additional context
Add any other context about the problem here.
Compiled into
#line 23 "/Volumes/RAM_Disk_4G/g/main.cpp2"
[[nodiscard]] auto main() -> int{
std::string s {"Hello,!\n"};
Wraper w {move(s)};
CPP2_UFCS(foo, w, move(s));
s = "asd";
std::cout << "after move ** " << std::move(s) << "**\n";
CPP2_UFCS_0(doPrint, w);
//s = "test2";
CPP2_UFCS_0(doPrint, std::move(w));
}
clang, don't prevent this, so it is just unexpected behavior (s could be empty, or ref to old value)
The text was updated successfully, but these errors were encountered:
shemeshg
changed the title
[BUG] Multiple move, reassign var after move works, expected to fail
[BUG] Multiple move, reassign or cout var after move works. - expected to fail
Sep 15, 2023
shemeshg
changed the title
[BUG] Multiple move, reassign or cout var after move works. - expected to fail
[BUG] Multiple move, reassign or cout var after move - works however expected to fail
Sep 15, 2023
This is the desired behaviour that it expected to happen. Moved-from variables are in well-formed state so you can do all those things with a moved-from variable. See comment #246 for more info.
Herb does mentions that he is interested in catching use-of-moved but with static analysis.
Describe the bug
The following example works, however it is expected to fail.
I can
To Reproduce
Steps to reproduce the behavior:
clanf 14, macos
Additional context
Add any other context about the problem here.
Compiled into
clang, don't prevent this, so it is just unexpected behavior (s could be empty, or ref to old value)
The text was updated successfully, but these errors were encountered: