Summary: | [Win] MSVC reports "DownloadBundleWin.cpp(87): error C2362: initialization of 'magic' is skipped by 'goto exit'" with /std:c++20 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Fujii Hironori <Hironori.Fujii> | ||||||||||
Component: | Platform | Assignee: | Fujii Hironori <Hironori.Fujii> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | achristensen, darin, don.olmstead, ross.kirsling, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Bug Depends on: | |||||||||||||
Bug Blocks: | 233448 | ||||||||||||
Attachments: |
|
Created attachment 447584 [details]
Patch
Created attachment 447624 [details]
Patch
Created attachment 447626 [details]
Patch
Committed r287299 (245451@main): <https://commits.webkit.org/245451@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 447626 [details]. Comment on attachment 447626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=447626&action=review > Source/WebCore/platform/network/win/DownloadBundleWin.cpp:47 > +}; There should not be a semicolon here. > Source/WebCore/platform/network/win/DownloadBundleWin.cpp:72 > + std::unique_ptr<FILE, decltype(&fileCloser)> bundle(bundlePtr, &fileCloser); Should be able to just write std::unique_ptr with no template arguments and rely on the deduction guide to deduce the argument types. > Source/WebCore/platform/network/win/DownloadBundleWin.cpp:107 > + std::unique_ptr<FILE, decltype(&fileCloser)> bundle(bundlePtr, &fileCloser); Ditto. reopened. Comment on attachment 447626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=447626&action=review >> Source/WebCore/platform/network/win/DownloadBundleWin.cpp:72 >> + std::unique_ptr<FILE, decltype(&fileCloser)> bundle(bundlePtr, &fileCloser); > > Should be able to just write std::unique_ptr with no template arguments and rely on the deduction guide to deduce the argument types. std::unique_ptr doesn't have the deduction guide. c++ - Why does std::unique_ptr not permit type inference? - Stack Overflow https://stackoverflow.com/q/41162868 c++ - Why can't unique_ptr's template arguments be deduced? - Stack Overflow https://stackoverflow.com/q/51109767 And, I want to specify a deleter in this case. And, C++17 lambda type doesn't have the default constructor. C++20 can compile the following code. > std::unique_ptr<FILE, decltype(&fileCloser)> bundle(bundlePtr); (In reply to Fujii Hironori from comment #8) > std::unique_ptr doesn't have the deduction guide. I understand why it can’t have one without a deleter; too bad it can’t have one with a deleter. Glad you investigated. Created attachment 447765 [details]
Patch
Committed r287432 (245567@main): <https://commits.webkit.org/245567@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 447765 [details]. |
[Win] MSVC reports "DownloadBundleWin.cpp(87): error C2362: initialization of 'magic' is skipped by 'goto exit'" with /std:c++20 > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(87): error C2362: initialization of 'magic' is skipped by 'goto exit' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(80): note: see declaration of 'magic' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(87): note: see declaration of 'exit' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(173): error C2362: initialization of 'footerStartPosition' is skipped by 'goto exit' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(150): note: see declaration of 'footerStartPosition' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(173): note: see declaration of 'exit' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(173): error C2362: initialization of 'footerLength' is skipped by 'goto exit' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(143): note: see declaration of 'footerLength' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(173): note: see declaration of 'exit' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(173): error C2362: initialization of 'footerLengthPosition' is skipped by 'goto exit' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(135): note: see declaration of 'footerLengthPosition' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(173): note: see declaration of 'exit' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(173): error C2362: initialization of 'footerMagicNumber' is skipped by 'goto exit' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(122): note: see declaration of 'footerMagicNumber' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(173): note: see declaration of 'exit' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(173): error C2362: initialization of 'footerMagicNumberPosition' is skipped by 'goto exit' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(115): note: see declaration of 'footerMagicNumberPosition' > Source\WebCore\platform\network\win\DownloadBundleWin.cpp(173): note: see declaration of 'exit'