From patchwork Mon Jan 15 15:02:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 860938 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-471271-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="PcXOzkZn"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKxbV55gvz9sBd for ; Tue, 16 Jan 2018 02:09:42 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=PbKBCgwFyISisqKJ+Pbx32QdbHkRHN5H7MK0aqABEbM7GrmBFDBPL /hIANh567DYpObph+OLSzO3sn5C/cBySGXe4ltaZj1W58MwsNR9cUFCIrP9x93T3 D9rv1NX9lBhAC63pAuy+mAX8UcakdGxuueryGT+vc/ZI1ua0Usw5KE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=wAuB6C7RLHBNJqGs6Sd41VWnC/U=; b=PcXOzkZnE38/lAOq5/kH Phh8uDarIB0HteZSSBXUIZMEuIG845pHtaYc+73lyN/w4joAwwUCmCZpNmBa5CRa ihkbgiGqL4JI6B4D1WRLUAbyo5KM03OQ+2csCjv7eGVwgS41FyVmorr1p547JXI0 XT1qqVP5cJlECRp69fP7yBM= Received: (qmail 45896 invoked by alias); 15 Jan 2018 15:02:40 -0000 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 Received: (qmail 45807 invoked by uid 89); 15 Jan 2018 15:02:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=(unknown) X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 15 Jan 2018 15:02:36 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D6584E4CA; Mon, 15 Jan 2018 15:02:35 +0000 (UTC) Received: from localhost (unknown [10.33.36.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF0055EDE4; Mon, 15 Jan 2018 15:02:34 +0000 (UTC) Date: Mon, 15 Jan 2018 15:02:34 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] PR libstdc++/83830 Define std::has_unique_object_representations_v Message-ID: <20180115150233.GA30173@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.1 (2017-09-22) Add this missing C++17 variable template. PR libstdc++/83830 * include/std/type_traits (has_unique_object_representations_v): Add variable template. * testsuite/20_util/has_unique_object_representations/value.cc: Check variable template. Tested powerpc64le-linux, committed to trunk. commit 37f21e406cb84c041adb1537079ced465a79e4be Author: Jonathan Wakely Date: Mon Jan 15 13:23:53 2018 +0000 PR libstdc++/83830 Define std::has_unique_object_representations_v PR libstdc++/83830 * include/std/type_traits (has_unique_object_representations_v): Add variable template. * testsuite/20_util/has_unique_object_representations/value.cc: Check variable template. diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 43ea68e6c6b..711d6c50dd1 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -2903,6 +2903,10 @@ template remove_cv_t> )> { }; + + template + inline constexpr bool has_unique_object_representations_v + = has_unique_object_representations<_Tp>::value; #endif #undef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP diff --git a/libstdc++-v3/testsuite/20_util/has_unique_object_representations/value.cc b/libstdc++-v3/testsuite/20_util/has_unique_object_representations/value.cc index c2a5873ee69..7ac97cf0ba4 100644 --- a/libstdc++-v3/testsuite/20_util/has_unique_object_representations/value.cc +++ b/libstdc++-v3/testsuite/20_util/has_unique_object_representations/value.cc @@ -108,3 +108,17 @@ void test01() static_assert(test_category(false), ""); } + +void +test02() +{ + using std::has_unique_object_representations; + using std::has_unique_object_representations_v; + + static_assert(has_unique_object_representations_v + == has_unique_object_representations::value); + static_assert(has_unique_object_representations_v + == has_unique_object_representations::value); + static_assert(has_unique_object_representations_v + == has_unique_object_representations::value); +}