From patchwork Tue Oct 22 22:04:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1181697 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-511532-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="R9wrB4qR"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="dg/nMJKt"; 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 46ySHF2yblz9sPc for ; Wed, 23 Oct 2019 09:05:10 +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=oJkAICDLOfUVBOuXaIO95KTwL6fTmrjiVhu7AwQM7Ukw14l6Rw69J YX0fDfAH9kq+nbUEZ27V6wYmE3DiSeU4WVFBANRZ64XNPGR8ricfL4JfmbljeP8P DD00B1a8UUNAtcHJGaC3E2zTrWJ3HLCUDTD3c4+fAJSS34VsVjd1ZI= 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=RMG3ES0l19yv7sRY12/X6H+znQs=; b=R9wrB4qR2OcWITxZvZC+ FKFk56jAhKZXWK9DrVBuNkIri25pmxUnL37rNpFeA7/jFo4mo+aBm5TJm05LXjKC OIqtHdVKAUqP45XAkcbADAcDHpuQESiqExpiZhXKLhg2N1y2xr3GkwnqbyJ1ptpD BiCboCVnXpZZtMXbI+0I4oE= Received: (qmail 62680 invoked by alias); 22 Oct 2019 22:05:02 -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 62671 invoked by uid 89); 22 Oct 2019 22:05:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT autolearn=ham version=3.3.1 spammy=17_intro, namescc, UD:names.cc, names.cc X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (207.211.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Oct 2019 22:05:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571781899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=o9U08XaINEv0g2ADyoJx20z9jbMRozJ4lI+WQCgMzMk=; b=dg/nMJKt+DGFzPgf/SQRG4b/QxvWGHe4K1NJA5tKFgARdF/m9fVsZll8/8unwoCxZOG44E EQoWgLbqpjyrHeVF3AqRm40ttsdIxvQDvK5pBaG1kBqlarIHP9TGxb4cHW8ky+evD2LO0s HayI/C/JEQP1TaP9ozOISHwzv6gG4Y4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-323-8harGATTPe2kdAYSWrhZ8g-1; Tue, 22 Oct 2019 18:04:52 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 112CC1005509; Tue, 22 Oct 2019 22:04:52 +0000 (UTC) Received: from localhost (unknown [10.33.36.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1D7C1001B09; Tue, 22 Oct 2019 22:04:51 +0000 (UTC) Date: Tue, 22 Oct 2019 23:04:50 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] Do not declare std::uses_allocator before C++11 Message-ID: <20191022220450.GN4169@redhat.com> MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.12.1 (2019-06-15) X-Mimecast-Spam-Score: 0 Content-Disposition: inline * include/bits/memoryfwd.h (uses_allocator): Do not declare for C++98. * testsuite/17_intro/names.cc: Check uses_allocator in C++98. Tested powerpc64le-linux, committed to trunk. This should be backported too, as it should never have been declared for C++98. commit cdbab4a65ff6fdbe44196a5903b27d06075e60e5 Author: Jonathan Wakely Date: Tue Oct 22 22:39:16 2019 +0100 Do not declare std::uses_allocator before C++11 * include/bits/memoryfwd.h (uses_allocator): Do not declare for C++98. * testsuite/17_intro/names.cc: Check uses_allocator in C++98. diff --git a/libstdc++-v3/include/bits/memoryfwd.h b/libstdc++-v3/include/bits/memoryfwd.h index d42eabeceb8..6542adc1cdd 100644 --- a/libstdc++-v3/include/bits/memoryfwd.h +++ b/libstdc++-v3/include/bits/memoryfwd.h @@ -68,9 +68,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION class allocator; #endif +#if __cplusplus >= 201103L /// Declare uses_allocator so it can be specialized in \ etc. template struct uses_allocator; +#endif /// @} group memory diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc index 3d6148fa0e8..81a1d6fdf46 100644 --- a/libstdc++-v3/testsuite/17_intro/names.cc +++ b/libstdc++-v3/testsuite/17_intro/names.cc @@ -103,6 +103,10 @@ #define tmp ( +#if __cplusplus < 201103L +#define uses_allocator ( +#endif + #if __cplusplus < 201703L // defines to_chars_result::ptr and to_chars_result::ec #define ec (