From patchwork Mon Jun 18 21:44:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 165614 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 B4A72B6FA9 for ; Tue, 19 Jun 2012 07:45:12 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1340660714; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=kpE4SPG yerEZOqKxZKHJa51t5oE=; b=bGrVneG8w862y7N6yXruoCA1fzs9exmTttadRYQ rwB5GXqkXdL7r3Bm9oBExr2VpY56H1f8LXWUsN47oT7kWwrOYxiiY20pU9msZFTJ v5WdxZNKmiiK7SJPb+OqCkpoaqGbatEDZN3mu5CNJE1OJRyKQsYQRyE2fGrQeLA0 fBw8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=orvUaojF+6zyhutr8JQmAR5z90UokpD0Hqh/w5Eze4NEdR7vHMAhuxH3fcHMJo oioLWQ9m8uknGfAnIUylWMCRFzr08/S88DyaGyH0l/4aAo/EspiSOoFQdOOJqEiB tnB41NFynpt65KDwhAaHU1SUS2Bp3gBN5ubghxmTRCv/I=; Received: (qmail 19753 invoked by alias); 18 Jun 2012 21:44:51 -0000 Received: (qmail 19733 invoked by uid 22791); 18 Jun 2012 21:44:48 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-lb0-f175.google.com (HELO mail-lb0-f175.google.com) (209.85.217.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Jun 2012 21:44:33 +0000 Received: by lbol5 with SMTP id l5so5232379lbo.20 for ; Mon, 18 Jun 2012 14:44:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.36.132 with SMTP id q4mr7147355lbj.63.1340055871202; Mon, 18 Jun 2012 14:44:31 -0700 (PDT) Received: by 10.112.48.6 with HTTP; Mon, 18 Jun 2012 14:44:31 -0700 (PDT) Date: Mon, 18 Jun 2012 22:44:31 +0100 Message-ID: Subject: fix libstdc++/53678 - namespace pollution on NetBSD From: Jonathan Wakely To: "libstdc++" , gcc-patches 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 This fixes a regression on NetBSD. 2012-06-18 Jörg Sonnenberger Jonathan Wakely PR libstdc++/53678 * config/os/bsd/netbsd/ctype_base.h: Check for _CTYPE_U. * testsuite/22_locale/ctype_base/53678.cc: New. Tested x86_64-unknown-netbsd5.1, committed to trunk, 4.7 and 4.6 to follow commit ec3a5e13dc6d1e3c1cf963baefbcf9fb89d15873 Author: Jonathan Wakely Date: Fri Jun 15 00:53:21 2012 +0100 2012-06-18 Jörg Sonnenberger Jonathan Wakely PR libstdc++/53678 * config/os/bsd/netbsd/ctype_base.h: Check for _CTYPE_U. * testsuite/22_locale/ctype_base/53678.cc: New. diff --git a/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h b/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h index d75cb79..cd654d6 100644 --- a/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h +++ b/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h @@ -1,6 +1,6 @@ // Locale support -*- C++ -*- -// Copyright (C) 2000, 2009 Free Software Foundation, Inc. +// Copyright (C) 2000, 2009, 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -31,8 +31,6 @@ // anoncvs@anoncvs.netbsd.org:/cvsroot/basesrc/include/ctype.h // See www.netbsd.org for details of access. -#include - namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -47,7 +45,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // on the mask type. Because of this, we don't use an enum. typedef unsigned char mask; -#if __NetBSD_Version__ < 599004100 +#ifndef _CTYPE_U static const mask upper = _U; static const mask lower = _L; static const mask alpha = _U | _L; diff --git a/libstdc++-v3/testsuite/22_locale/ctype_base/53678.cc b/libstdc++-v3/testsuite/22_locale/ctype_base/53678.cc new file mode 100644 index 0000000..e4a9f07 --- /dev/null +++ b/libstdc++-v3/testsuite/22_locale/ctype_base/53678.cc @@ -0,0 +1,28 @@ +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// { dg-do compile } + +// 22.2.1 The ctype category + +#include + +// libstdc++/53678 +void test01() +{ + bool NetBSD __attribute__((unused)) = true; +}