From 2c259990da2c5db5901ae955ae09764c6b2b596d Mon Sep 17 00:00:00 2001 From: Phil Christensen Date: Thu, 5 Jan 2017 09:38:41 -0800 Subject: [PATCH] fix permissive C++ code (MSVC /permissive-) These were found by the C++ compiler group when doing "Real world code" build tests using /permissive-. We are sharing these with you to help clean up your code before the new version of the compiler comes out. For more information on /permissive- see https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/. In paticular, see the "Do not treat copy initialization as direct initialization" section of the blog. --- atom/browser/ui/win/jump_list.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/atom/browser/ui/win/jump_list.cc b/atom/browser/ui/win/jump_list.cc index 5cd2af8dd..de2ee931d 100644 --- a/atom/browser/ui/win/jump_list.cc +++ b/atom/browser/ui/win/jump_list.cc @@ -31,7 +31,7 @@ bool AppendTask(const JumpListItem& item, IObjectCollection* collection) { item.icon_index))) return false; - CComQIPtr property_store = link; + CComQIPtr property_store(link); if (!base::win::SetStringValueForPropertyStore(property_store, PKEY_Title, item.title.c_str())) return false; @@ -44,7 +44,7 @@ bool AppendSeparator(IObjectCollection* collection) { CComPtr shell_link; if (SUCCEEDED(shell_link.CoCreateInstance(CLSID_ShellLink))) { - CComQIPtr property_store = shell_link; + CComQIPtr property_store(shell_link); if (base::win::SetBooleanValueForPropertyStore( property_store, PKEY_AppUserModel_IsDestListSeparator, true)) return SUCCEEDED(collection->AddObject(shell_link)); @@ -254,7 +254,7 @@ JumpListResult JumpList::AppendCategory(const JumpListCategory& category) { result = JumpListResult::GENERIC_ERROR; } - CComQIPtr items = collection; + CComQIPtr items(collection); if (category.type == JumpListCategory::Type::TASKS) { if (FAILED(destinations_->AddUserTasks(items))) {