<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>220662</bug_id>
          
          <creation_ts>2021-01-15 11:52:00 -0800</creation_ts>
          <short_desc>std::is_literal_type causes -Wdeprecated-declarations warning with GCC 11</short_desc>
          <delta_ts>2021-03-03 14:23:24 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Template Framework</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=211674</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>benjamin</cc>
    
    <cc>cdumez</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>darin</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>sam</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1719936</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-01-15 11:52:00 -0800</bug_when>
    <thetext>It seems std::is_literal_type was removed from C++ 20, so now GCC is warning that we use it in wtf/Variant.h:

DerivedSources/ForwardingHeaders/wtf/Variant.h:390:35: warning: &apos;template&lt;class _Tp&gt; struct std::is_literal_type&apos; is deprecated [-Wdeprecated-declarations]
  390 | template&lt;typename _Type,bool=std::is_literal_type&lt;_Type&gt;::value&gt;
      |                                   ^~~~~~~~~~~~~~~

This header is included in a lot of places, so it spams the build log pretty badly. Sadly, std::is_literal_type was removed without replacement. More info here: https://stackoverflow.com/questions/40351816/deprecated-stdis-literal-type-in-c17#40352351. So solution is a little unclear. I might just suppress the warning with IGNORE_WARNINGS and keep the current behavior... other proposals welcome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1721662</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-01-22 11:52:15 -0800</bug_when>
    <thetext>&lt;rdar://problem/73509470&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1721687</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-01-22 12:48:28 -0800</bug_when>
    <thetext>Maybe we can look for newer Variant implementations?

We added WTF::Variant to get something like std::variant earlier. Like WTF::Optional, some of us intended this as a stopgap, and eventually we’d just move along to std::variant. But in the case of WTF::Optional, we grew to like at least one of the semantics we chose for our version, and may delay switching over indefinitely. It’s possible that is not try for WTF::Variant, so perhaps we can just switch over to std::variant?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1721700</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-01-22 13:20:41 -0800</bug_when>
    <thetext>(In reply to Darin Adler from comment #2)
&gt; It’s possible that is not try for WTF::Variant, so perhaps we can just switch over to std::variant?

You&apos;re right. We should give this a try.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1721737</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-01-22 15:22:00 -0800</bug_when>
    <thetext>Here are my preferences for solutions to this:

- switch to std::variant

- update to (or maybe it’s &quot;merge in&quot;) a newer version of the variant implementation; in r204227, Sam Weinig got it from https://bitbucket.org/anthonyw/variant/src and we could look there for a newer version

- disable this warning just for Variant.h

- patch our Variant.h to sidestep the lack of is_literal_type (might be straightforward to do it at least well enough to not break WebKit?)

- disable this warning globally

We can also do any combination of these, and do one first and then move up to the &quot;better solutions&quot; later. I’d like to climb from the bottom up to the top as far as we can go.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1734958</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-03-02 12:01:53 -0800</bug_when>
    <thetext>(In reply to Darin Adler from comment #4)
&gt; - disable this warning just for Variant.h

I&apos;m going to take the path of least resistance and disable the warning... but it only needs to be done for the one function where it&apos;s used, not for the entire file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1735138</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-03-02 17:20:52 -0800</bug_when>
    <thetext>(No patch yet because I got sucked into a quixotic quest to see how hard it would be to switch to std::variant after all.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1735449</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-03-03 12:43:55 -0800</bug_when>
    <thetext>It&apos;s not necessarily hard, but we use it in a lot of places, and it requires more time than I have available to adjust them all.

I also attempted to hoist std::variant and its related methods (std::get, std::visit, std::holds_alternative) into the WTF namespace, but failed at that too. We also have one customization, WTF::switchOn, that could justify keeping wtf/Variant.h even if we were to successfully migrate to std::variant.

Next I tried adjusting the code to no longer use std::is_literal_type, but after squinting for a while I decided I&apos;d better not touch it.

I tried searching for an updated version of our variant, but the upstream no longer exists.

I tried searching for a new upstream that we could use. https://github.com/mpark/variant/ looks like a good option, and it&apos;s license-compatible. One compiler warning seems like not a very great reason to switch from one implementation to another, though. 

I&apos;m just going to silence the warning. This function is removed from C++ 20, but I assume libstdc++ and libc++ will both keep it around forever. If it ever gets removed, then we&apos;ll need to revisit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1735458</commentid>
    <comment_count>8</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-03-03 12:56:29 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #7)
&gt; I&apos;m just going to silence the warning.

Good call, thumbs up.

I’m eager to *eventually* get to std::variant and also to std::optional and I hope someone will do those projects.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1735459</commentid>
    <comment_count>9</comment_count>
      <attachid>422138</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-03-03 12:57:26 -0800</bug_when>
    <thetext>Created attachment 422138
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1735460</commentid>
    <comment_count>10</comment_count>
      <attachid>422138</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-03-03 12:58:40 -0800</bug_when>
    <thetext>Comment on attachment 422138
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=422138&amp;action=review

&gt; Source/WTF/ChangeLog:6607
&gt; -             use the RunLoop. Let&apos;s match them for consistency, and to delete some
&gt; +        As of https://bugs.webkit.org/show_bug.cgi?id=213063, Darwin platforms
&gt; +        use the RunLoop. Let&apos;s match them for consistency, and to delete some

The old ChangeLog here got corrupted somehow, and gedit won&apos;t allow saving the original data.

This is the sort of thing that&apos;s probably best fixed by pushing to SVN directly without using webkit-patch, but I don&apos;t have an SVN account anymore. I&apos;ve just been relying on commit-queue since I left Igalia.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1735463</commentid>
    <comment_count>11</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-03-03 13:03:30 -0800</bug_when>
    <thetext>(In reply to Darin Adler from comment #8)
&gt; Good call, thumbs up.
&gt; 
&gt; I’m eager to *eventually* get to std::variant and also to std::optional and
&gt; I hope someone will do those projects.

I would like to use std::optional too, but I think WTF::Optional has some important subtle behavior difference that our code may rely on in an unknown number of places. But I cannot remember what it is! We had a long webkit-dev mailing list conversation about it a few years ago, but after searching our list archives for two minutes, I wasn&apos;t immediately able to find it.

In contrast, switching to std::variant should *probably* be fairly safe.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1735466</commentid>
    <comment_count>12</comment_count>
      <attachid>422138</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-03-03 13:04:52 -0800</bug_when>
    <thetext>Comment on attachment 422138
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=422138&amp;action=review

&gt;&gt; Source/WTF/ChangeLog:6607
&gt;&gt; +        use the RunLoop. Let&apos;s match them for consistency, and to delete some
&gt; 
&gt; The old ChangeLog here got corrupted somehow, and gedit won&apos;t allow saving the original data.
&gt; 
&gt; This is the sort of thing that&apos;s probably best fixed by pushing to SVN directly without using webkit-patch, but I don&apos;t have an SVN account anymore. I&apos;ve just been relying on commit-queue since I left Igalia.

Seems fine to do it this way.

I don’t really understand the role of &quot;gedit&quot; here, but the patch seems fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1735470</commentid>
    <comment_count>13</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-03-03 13:06:00 -0800</bug_when>
    <thetext>gedit is the GNOME text editor!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1735472</commentid>
    <comment_count>14</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-03-03 13:08:17 -0800</bug_when>
    <thetext>WTF::Optional has a difference from some std::optional implementations: the move assignment operator sets the old object to WTF::nullopt. This difference is something we may have relied on in the past but we do not have solid evidence that we still rely on it; in fact when testing a patch to convert to std::optional I saw no test failures. In new code we try to use std::exchange when we rely on that behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1735520</commentid>
    <comment_count>15</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2021-03-03 14:23:21 -0800</bug_when>
    <thetext>Committed r273841: &lt;https://commits.webkit.org/r273841&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 422138.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>422138</attachid>
            <date>2021-03-03 12:57:26 -0800</date>
            <delta_ts>2021-03-03 14:23:22 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-220662-20210303145726.patch</filename>
            <type>text/plain</type>
            <size>2049</size>
            <attacher name="Michael Catanzaro">mcatanzaro</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjczODI5CmRpZmYgLS1naXQgYS9Tb3VyY2UvV1RGL0NoYW5n
ZUxvZyBiL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCmluZGV4IGZlYjU0ZTkwN2EwNTQ3MjFiMDE0MmMz
MjY1NDVlMWQ2NGYyNmRkZTQuLmQyMTgzNDBjMDA0ZDJiYzQ5OTI2ZmU4OGJmNjdmYWJhOTIzNWY2
ZjAgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9XVEYvQ2hh
bmdlTG9nCkBAIC0xLDMgKzEsMTYgQEAKKzIwMjEtMDMtMDMgIE1pY2hhZWwgQ2F0YW56YXJvICA8
bWNhdGFuemFyb0Bnbm9tZS5vcmc+CisKKyAgICAgICAgc3RkOjppc19saXRlcmFsX3R5cGUgY2F1
c2VzIC1XZGVwcmVjYXRlZC1kZWNsYXJhdGlvbnMgd2FybmluZyB3aXRoIEdDQyAxMQorICAgICAg
ICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MjIwNjYyCisgICAgICAg
IDxyZGFyOi8vcHJvYmxlbS83MzUwOTQ3MD4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkg
KE9PUFMhKS4KKworICAgICAgICBJZ25vcmUgdGhlIHdhcm5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