From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 6F1543856244 for ; Tue, 12 Jul 2022 18:36:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6F1543856244 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-590-7PrCX0h7NQKagwm6ZFixXw-1; Tue, 12 Jul 2022 14:36:56 -0400 X-MC-Unique: 7PrCX0h7NQKagwm6ZFixXw-1 Received: by mail-qk1-f200.google.com with SMTP id bm2-20020a05620a198200b006a5dac37fa2so8418712qkb.16 for ; Tue, 12 Jul 2022 11:36:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=PAlzSbnmSTH1zWeAWspxzYouO760KMZSElp6PE4rA3M=; b=sKfuJR4y21U4nm/tch7O0RKtkjXoAhRut3xCytJNYzmbu1g1qOk4Azvhvak8RCsbve DojAUj6gtUmnh5XCCFbYmyCHrPzECXrlXnERgFg0Yt0jtNyn0ZT+OrUA3lqKn40fkVGG HJMewlCaOrygLXKiYpUr8QKe5YqtQ2757DK9/6j2eDJ7zROBjqQ6qfXPFKMlRiZLXhQM wmQM4LA2+Vjjqtr7Z/6HMzOOF+peGsSvBQ20csiCiHahh0Z1+O4r0vz02CCxaHJwUNRP JFsVH65H5hE+0BvypXbiBePvNF1RdjmoopT4NZXlk/mOUsLHmfVU4qq5tI3LOqs0Pqzn 0vmw== X-Gm-Message-State: AJIora92EH0Vj1GdZlQkwyNs23gJjaI9rwBE5TvWycq5S1Kl8gnbRbC+ SrBLiXOO79B74E/P/XovIeAeqxIFC73z2PP9JEqLeVR39CEaG9E2Pi3TrTZptziRcvowZ3Lv1qf VDrxUJ5+znNDLtNYIjw== X-Received: by 2002:a05:622a:1a8c:b0:31e:bbe7:6de7 with SMTP id s12-20020a05622a1a8c00b0031ebbe76de7mr5480738qtc.116.1657651015501; Tue, 12 Jul 2022 11:36:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1snwE+RDAIdgS5kWXeR18CE0ifo+R4AhJRweXnfeSUPA2ScWzq+SZ8aRFYjPA532/GEHGAxTA== X-Received: by 2002:a05:622a:1a8c:b0:31e:bbe7:6de7 with SMTP id s12-20020a05622a1a8c00b0031ebbe76de7mr5480727qtc.116.1657651015291; Tue, 12 Jul 2022 11:36:55 -0700 (PDT) Received: from t14s.localdomain (c-73-69-212-193.hsd1.ma.comcast.net. [73.69.212.193]) by smtp.gmail.com with ESMTPSA id t16-20020ac85310000000b003177969a48fsm7824994qtn.21.2022.07.12.11.36.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 11:36:54 -0700 (PDT) Message-ID: Subject: Re: [PATCH 1/2] Add gcc/make-unique.h From: David Malcolm To: Pedro Alves , Jonathan Wakely Cc: gcc-patches Date: Tue, 12 Jul 2022 14:36:53 -0400 In-Reply-To: <55f00de5-6c6b-51f3-01d4-5f7710e2c792@palves.net> References: <20220712002527.417444-1-dmalcolm@redhat.com> <03b8afc0-b917-e940-4995-9ba5493567c2@palves.net> <7f2ddb2d-da00-6852-339a-86c7d853087f@palves.net> <55f00de5-6c6b-51f3-01d4-5f7710e2c792@palves.net> User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2022 18:36:58 -0000 On Tue, 2022-07-12 at 17:40 +0100, Pedro Alves wrote: > On 2022-07-12 4:14 p.m., Jonathan Wakely wrote: > > > >  So once GCC requires C++14, why would you want to preserve I look forward to the happy day when we can use C++14 in GCC's implementation, but I don't see it happening anytime soon. GCC's needs may differ from those of GDB's. I'm not very familiar with GDB's insides, but, for example, GCC has its own garbage-collector which complicates everything to do with memory managements. Right now I have comments expressing ownership of some pointers, and e.g. "takes ownership of ...". It would be wonderful to take some baby steps into using C++11 to express the ownership directly in code. > > > once-backported symbols in a namespace other than std, when you > > > no longer have a reason to? > > > It will just be another unnecessary thing that newcomers at that > > > future time will have > > > to learn. > > > > I also don't see a problem with importing std::make_unique into > > namespace gcc for local use alongside other things in namespace > > gcc. I > > do consider that idiomatic. It says "the make_unique for gcc code > > is > > std::make_unique". It means you only need a 'using namespace gcc;' > > at > > the top of a source file and you get access to everything in > > namespace > > gcc, even if it is something like std::make_unique that was > > originally > > defined in a different namespace. Jonathan's idea sounds good to me. > > > > If that's the approach, then GCC should import std::unique_ptr, > std::move, > std::foo, std::bar into the gcc namespace too, no?  Are you really > going > to propose that? Pedro, it feels to me like you're constructing a strawman here. Neither me nor Jonathan are proposing that. I just want to be able to comfortably use std::unique_ptr in GCC in the places for which it makes sense, and being able to use "make_unique" is a part of that. Hope this is constructive Dave