]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Avoid using sizeof with function types (PR 93470)
authorJonathan Wakely <jwakely@redhat.com>
Thu, 5 Mar 2020 16:52:19 +0000 (16:52 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 5 Mar 2020 17:32:16 +0000 (17:32 +0000)
Backport from mainline
2020-01-28  Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/93470
* include/bits/refwrap.h (reference_wrapper::operator()): Restrict
static assertion to object types.

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/refwrap.h

index bcac85143f2ef2f650cf33421ccaab756ac8de44..e99784118c6a902bc1a1f503d40f40bdb0bd03ee 100644 (file)
@@ -1,3 +1,19 @@
+2020-03-05  Jonathan Wakely  <jwakely@redhat.com>
+
+       Backport from mainline
+       2020-01-28  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR libstdc++/93470
+       * include/bits/refwrap.h (reference_wrapper::operator()): Restrict
+       static assertion to object types.
+
+2020-01-28  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR libstdc++/93325
+       * acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Use AC_SEARCH_LIBS for
+       clock_gettime instead of explicit glibc version check.
+       * configure: Regenerate.
+
 2020-03-01  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Updated.
index 6b4335a22ac688de8e751636bf4944fef68986a6..d95f7c5717266c3b1b6bc1178c4b9449e03b3435 100644 (file)
@@ -334,7 +334,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)...);
        }