[llvm] [llvm] Support building with c++23 (PR #154372)
Kyle Krüger via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 20 01:40:28 PDT 2025
================
@@ -36,7 +36,7 @@ class MachineFunctionAnalysis
std::unique_ptr<MachineFunction> MF;
public:
- Result(std::unique_ptr<MachineFunction> MF) : MF(std::move(MF)) {}
+ Result(std::unique_ptr<MachineFunction> MF);
----------------
kykrueger wrote:
Here is [another mention](https://github.com/hsutter/cppfront/pull/1083) of this issue from a different project. The consensus there is that the other compilers are allowing invalid c++ code according to the standard, and that . So rather I'd say that these errors are the result of a bug-fix.
As commented in the linked issue:
> If fact [cppreference.com](https://en.cppreference.com/w/cpp/memory/unique_ptr) states that:
>> std::unique_ptr may be constructed for an [incomplete type](https://en.cppreference.com/w/cpp/language/incomplete_type) T, such as to facilitate the use as a handle in the [pImpl idiom](https://en.cppreference.com/w/cpp/language/pimpl). If the default deleter is used, T must be complete at the point in code where the deleter is invoked, which happens in the destructor, move assignment operator, and reset member function of std::unique_ptr.
https://github.com/llvm/llvm-project/pull/154372
More information about the llvm-commits
mailing list