RESOLVED FIXED 58131
Fix compilation with Solaris 10/Sun Studio 12: moving elements in a vector requires source not to be const
https://bugs.webkit.org/show_bug.cgi?id=58131
Summary Fix compilation with Solaris 10/Sun Studio 12: moving elements in a vector re...
Ben Taylor
Reported 2011-04-08 03:19:11 PDT
I don't know why the compiler couldn't call src->~T() on a const T *src, but fact is it couldn't. In any case, since move is copying the source and deleting it, formally the argument shouldn't be const anyway.
Attachments
Fixing a compile issue on Solaris 10 with Sun Studio 12 C++, fix a modified src parameter to not be const (2.87 KB, patch)
2011-04-08 04:52 PDT, Ben Taylor
no flags
Updated patch per recommendation of reviewer. This makes it very clear why we fix what we do. (1.18 KB, patch)
2011-04-12 19:38 PDT, Ben Taylor
no flags
Ben Taylor
Comment 1 2011-04-08 04:52:27 PDT
Created attachment 88801 [details] Fixing a compile issue on Solaris 10 with Sun Studio 12 C++, fix a modified src parameter to not be const Patch to fix the compile issue on Solaris 10 with Sun Studio 12, originally created by Thiago Macieria as part of patch11/17 from bug https://bugs.webkit.org/show_bug.cgi?id=24932
Alexey Proskuryakov
Comment 2 2011-04-08 11:41:30 PDT
+ Fix compile issue on Solaris 10/Sun Studio 12, since the move is copying + the source and deleting it, formally the argument shouldn't be const anyway. This is a questionable explanation. The ability to delete an object via a const pointer is a normal C++ behavior, and playing against C++ is not safe. Wouldn't it be better to do a const_cast when destructing as a workaround? Besides, if src should be non-const, why doesn't the same apply to srcEnd?
Ben Taylor
Comment 3 2011-04-12 19:38:31 PDT
Created attachment 89328 [details] Updated patch per recommendation of reviewer. This makes it very clear why we fix what we do. This patch is to work around an obscure compiler bug in Sun Studio 12 (fixed in SS12.1 and SS12.2) where the compiler couldn't call src->~T() on a const T *src
Alexey Proskuryakov
Comment 4 2011-04-12 21:35:55 PDT
Comment on attachment 89328 [details] Updated patch per recommendation of reviewer. This makes it very clear why we fix what we do. Do you know how long we'll have to support these old versions of the compiler? Why are they still important?
WebKit Commit Bot
Comment 5 2011-04-12 23:45:48 PDT
Comment on attachment 89328 [details] Updated patch per recommendation of reviewer. This makes it very clear why we fix what we do. Clearing flags on attachment: 89328 Committed r83704: <http://trac.webkit.org/changeset/83704>
WebKit Commit Bot
Comment 6 2011-04-12 23:45:54 PDT
All reviewed patches have been landed. Closing bug.
Ben Taylor
Comment 7 2011-04-13 03:07:14 PDT
(In reply to comment #4) > (From update of attachment 89328 [details]) > Do you know how long we'll have to support these old versions of the compiler? Why are they still important? SS12 is important as it can still build QT/webkit on Solaris 10. SS12.1/12.2 is a new compiler engine, and specificially SS12.2 has bugs that *fail* the compiler with an internal error. Additionally, Even if that bug is fixed, you have to now have a support contract to get the fix.
Note You need to log in before you can comment on or make changes to this bug.