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
//=== 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;
}
The text was updated successfully, but these errors were encountered:
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.
Title: Implicit move before taking address of member.
Minimal reproducer (https://cpp2.godbolt.org/z/651rnTT7b):
Commands:
cppfront main.cpp2 clang++17 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -fsanitize=undefined -Werror=unused-result -I . main.cpp
Expected result: No implicit move, like in other problematic cases.
Actual result and error:
Cpp2 lowered to Cpp1:
The text was updated successfully, but these errors were encountered: