8000 Fix "invalid application of 'sizeof' to an incomplete type" (#148854) · pytorch/pytorch@295f2ed · GitHub
[go: up one dir, main page]

Skip to content

Commit 295f2ed

Browse files
cyyeverpytorchmergebot
authored andcommitted
Fix "invalid application of 'sizeof' to an incomplete type" (#148854)
Fixes with C++23 and constexpr std::unique_ptr Pull Request resolved: #148854 Approved by: https://github.com/Skylion007
1 parent a6e71db commit 295f2ed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

torch/_export/serde/schema_check.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,9 @@ class ForwardRef {{
446446
447447
public:
448448
ForwardRef(): ptr_(std::make_unique<T>()) {{}}
449-
ForwardRef(ForwardRef<T>&&) = default;
449+
ForwardRef(ForwardRef<T>&&);
450450
ForwardRef(const ForwardRef<T>& other): ptr_(std::make_unique<T>(*other.ptr_)) {{}}
451-
ForwardRef<T>& operator=(ForwardRef<T>&&) = default;
451+
ForwardRef<T>& operator=(ForwardRef<T>&&);
452452
ForwardRef<T>& operator=(const ForwardRef<T>& other) {{
453453
ptr_ = std::make_unique<T>(*other.ptr_);
454454
return *this;
@@ -521,6 +521,9 @@ class F64 {{
521521
{"".join(cpp_enum_defs.values())}
522522
{"".join(dict(sorted(cpp_class_defs.items(), key=lambda x: class_ordering[x[0]])).values())}
523523
{chr(10).join(cpp_json_defs)}
524+
525+
template <typename T> ForwardRef<T>::ForwardRef(ForwardRef<T>&&) = default;
526+
template <typename T> ForwardRef<T>& ForwardRef<T>::operator=(ForwardRef<T>&&) = default;
524527
}} // namespace _export
525528
}} // namespace torch
526529
"""

0 commit comments

Comments
 (0)
0