From patchwork Tue Jan 18 11:13:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 79287 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 8F5BDB70CD for ; Tue, 18 Jan 2011 22:13:20 +1100 (EST) Received: (qmail 2688 invoked by alias); 18 Jan 2011 11:13:18 -0000 Received: (qmail 2673 invoked by uid 22791); 18 Jan 2011 11:13:17 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from vsmtp21.tin.it (HELO vsmtp21.tin.it) (212.216.176.109) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 Jan 2011 11:13:12 +0000 Received: from [192.168.0.4] (79.43.214.157) by vsmtp21.tin.it (8.5.132) id 4CFDFB8E02AF82B6; Tue, 18 Jan 2011 12:13:09 +0100 Message-ID: <4D3575C5.3020402@oracle.com> Date: Tue, 18 Jan 2011 12:13:09 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: libstdc++ Subject: [v3] Implement DR 1517 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, tested x86_64-linux, committed to mainline. Paolo. ///////////////////// 2011-01-18 Paolo Carlini * include/bits/unique_ptr.h (default_delete<>::default_delete()): Declare defaulted per DR 1517. * testsuite/util/testsuite_common_types.h (constexpr_defaulted_default_constructible): Add. * testsuite/20_util/default_delete/cons/constexpr.cc: Use it. Index: include/bits/unique_ptr.h =================================================================== --- include/bits/unique_ptr.h (revision 168946) +++ include/bits/unique_ptr.h (working copy) @@ -47,7 +47,7 @@ template struct default_delete { - constexpr default_delete() { } + constexpr default_delete() = default; template::value>::type> @@ -68,7 +68,7 @@ template struct default_delete<_Tp[]> { - constexpr default_delete() { } + constexpr default_delete() = default; void operator()(_Tp* __ptr) const Index: testsuite/util/testsuite_common_types.h =================================================================== --- testsuite/util/testsuite_common_types.h (revision 168946) +++ testsuite/util/testsuite_common_types.h (working copy) @@ -644,7 +644,7 @@ template::value> struct _Concept; - // NB: _Tp must be a literal type. + // NB: _Tp must be a literal type. // Have to have user-defined default ctor for this to work. template struct _Concept<_Tp, true> @@ -671,6 +671,24 @@ } }; + // Generator to test defaulted default constructor. + struct constexpr_defaulted_default_constructible + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { constexpr _Tp __v __attribute__((unused)) { }; } + }; + + void (_Concept::*__x)() __attribute__((unused)) + = &_Concept::__constraint; + } + }; + struct constexpr_single_value_constructible { template>(); return 0; }