Message ID | 20200128133121.GA53656@redhat.com |
---|---|
State | New |
Headers | show |
Series | [COMMITTED] libstdc++: Avoid using sizeof with function types (PR 93470) | expand |
diff --git a/libstdc++-v3/include/bits/refwrap.h b/libstdc++-v3/include/bits/refwrap.h index 2bcd44d3894..717aa01629c 100644 --- a/libstdc++-v3/include/bits/refwrap.h +++ b/libstdc++-v3/include/bits/refwrap.h @@ -343,7 +343,8 @@ _GLIBCXX_MEM_FN_TRAITS(&& noexcept, false_type, true_type) operator()(_Args&&... __args) const { #if __cplusplus > 201703L - static_assert(sizeof(type), "type must be complete"); + if constexpr (is_object_v<type>) + static_assert(sizeof(type), "type must be complete"); #endif return std::__invoke(get(), std::forward<_Args>(__args)...); }