Changeset 225896 in webkit


Ignore:
Timestamp:
Dec 14, 2017 12:17:56 AM (6 years ago)
Author:
Yusuke Suzuki
Message:

REGRESSION(r225769): Build errors with constexpr std::tie on older gcc
https://bugs.webkit.org/show_bug.cgi?id=180692

Reviewed by Carlos Garcia Campos.

Source/WebCore:

  • platform/graphics/FontSelectionAlgorithm.h:

(WebCore::FontSelectionRange::operator== const):
(WebCore::FontSelectionRequest::tied const):
(WebCore::FontSelectionCapabilities::tied const):
(WebCore::FontSelectionSpecifiedCapabilities:: const):

Source/WTF:

Due to libstdc++'s bug[1], std::tie is not annotated with constexpr in libstdc++ 5.
This patch adds WTF::tie for a work around. Since we do not want to
include <tuple> in StdLibExtras.h, we define this function for all
the compilers.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65978

  • wtf/StdLibExtras.h:
Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r225857 r225896  
     12017-12-12  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        REGRESSION(r225769): Build errors with constexpr std::tie on older gcc
     4        https://bugs.webkit.org/show_bug.cgi?id=180692
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Due to libstdc++'s bug[1], std::tie is not annotated with constexpr in libstdc++ 5.
     9        This patch adds WTF::tie for a work around. Since we do not want to
     10        include <tuple> in StdLibExtras.h, we define this function for all
     11        the compilers.
     12
     13        [1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65978
     14
     15        * wtf/StdLibExtras.h:
     16
    1172017-12-13  Mark Lam  <mark.lam@apple.com>
    218
  • trunk/Source/WTF/wtf/StdLibExtras.h

    r225672 r225896  
    446446}
    447447
     448// libstdc++5 does not have constexpr std::tie. Since we cannot redefine std::tie with constexpr, we define WTF::tie instead.
     449// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65978
     450template <class ...Args>
     451inline constexpr std::tuple<Args&...> tie(Args&... values) noexcept
     452{
     453    return std::tuple<Args&...>(values...);
     454}
     455
    448456} // namespace WTF
    449457
  • trunk/Source/WebCore/ChangeLog

    r225885 r225896  
     12017-12-12  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        REGRESSION(r225769): Build errors with constexpr std::tie on older gcc
     4        https://bugs.webkit.org/show_bug.cgi?id=180692
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * platform/graphics/FontSelectionAlgorithm.h:
     9        (WebCore::FontSelectionRange::operator== const):
     10        (WebCore::FontSelectionRequest::tied const):
     11        (WebCore::FontSelectionCapabilities::tied const):
     12        (WebCore::FontSelectionSpecifiedCapabilities:: const):
     13
    1142017-12-13  Daniel Bates  <dabates@apple.com>
    215
  • trunk/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h

    r225769 r225896  
    284284    constexpr bool operator==(const FontSelectionRange& other) const
    285285    {
    286         return std::tie(minimum, maximum) == std::tie(other.minimum, other.maximum);
     286        return WTF::tie(minimum, maximum) == WTF::tie(other.minimum, other.maximum);
    287287    }
    288288
     
    335335    constexpr std::tuple<Value, Value, Value> tied() const
    336336    {
    337         return std::tie(weight, width, slope);
     337        return WTF::tie(weight, width, slope);
    338338    }
    339339
     
    372372    constexpr std::tuple<Range, Range, Range> tied() const
    373373    {
    374         return std::tie(weight, width, slope);
     374        return WTF::tie(weight, width, slope);
    375375    }
    376376
     
    420420    constexpr std::tuple<OptionalRange&, OptionalRange&, OptionalRange&> tied()
    421421    {
    422         return std::tie(weight, width, slope);
     422        return WTF::tie(weight, width, slope);
    423423    }
    424424
    425425    constexpr std::tuple<const OptionalRange&, const OptionalRange&, const OptionalRange&> tied() const
    426426    {
    427         return std::tie(weight, width, slope);
     427        return WTF::tie(weight, width, slope);
    428428    }
    429429
Note: See TracChangeset for help on using the changeset viewer.