⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 284566 in webkit


Ignore:
Timestamp:
Oct 20, 2021, 2:07:20 PM (5 years ago)
Author:
Fujii Hironori
Message:

The code decoding std::optional<ImagePaintingOptions> can't be compiled by PlayStation due to the ImagePaintingOptions template constructor
https://bugs.webkit.org/show_bug.cgi?id=231980

Reviewed by Ross Kirsling.

PlayStation clang can't compile the following code.

std::optional<ImagePaintingOptions> val;
decoder >> val;

It reports the following error.

include\type_traits:3825:31: error: no member named 'value' in 'std::is_convertible<optional<WebCore::ImagePaintingOptions> &, WebCore::ImagePaintingOptions>'

  • platform/graphics/ImagePaintingOptions.h:

(WebCore::ImagePaintingOptions::ImagePaintingOptions): Use SFINAE
for the first template constructor not to conflict with the second
one.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r284550 r284566  
     12021-10-20  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        The code decoding std::optional<ImagePaintingOptions> can't be compiled by PlayStation due to the ImagePaintingOptions template constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=231980
     5
     6        Reviewed by Ross Kirsling.
     7
     8        PlayStation clang can't compile the following code.
     9        > std::optional<ImagePaintingOptions> val;
     10        > decoder >> val;
     11
     12        It reports the following error.
     13        > include\type_traits:3825:31: error: no member named 'value' in 'std::is_convertible<optional<WebCore::ImagePaintingOptions> &, WebCore::ImagePaintingOptions>'
     14
     15        * platform/graphics/ImagePaintingOptions.h:
     16        (WebCore::ImagePaintingOptions::ImagePaintingOptions): Use SFINAE
     17        for the first template constructor not to conflict with the second
     18        one.
     19
    1202021-10-20  Sihui Liu  <sihui_liu@apple.com>
    221
  • trunk/Source/WebCore/platform/graphics/ImagePaintingOptions.h

    r283287 r284566  
    3333
    3434struct ImagePaintingOptions {
    35     template<typename... Options>
    36     ImagePaintingOptions(Options... options)
     35    template<typename First, typename... Rest, typename = std::enable_if_t<!std::is_same_v<std::decay_t<First>, ImagePaintingOptions>>>
     36    ImagePaintingOptions(First first, Rest... rest)
    3737    {
    38         setOption(options...);
     38        setOption(first, rest...);
    3939    }
    4040
Note: See TracChangeset for help on using the changeset viewer.