From patchwork Tue Jun 11 09:52:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 250516 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 114EC2C0098 for ; Tue, 11 Jun 2013 19:52:46 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=faCBnBh0Yan/NetkemohRtsx1UZf79JqEhFJp9GSnqY 4GWnSfHviPdTd4Wk/llvmp6pRuBPTN56Ss860d5A8uDT8Z+u/j1nfHE6S+Ze/vXB ulVbT+fqJo6XbZewEkBJV3KP/l2EILA0dBbPbnaIe8Wn3UXODHiGsyUWLvX/JdNo = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=cKl24gqYMmct/pg7cCXEMpxfD1s=; b=lsCao85Q6i6TjFBfO BvNwK9rMWESGU2baXJ7AhcVa3Xi7GPHOwkYl+AKIjoyHUVlE0b+Eczvw3azV2pnY 2lrwpod+0EtzBko2VN/N0rFc7qS22ztR+YVLlA+cSxtKwdbJDjtQF4LRxuMj+0k8 ZRsRduEfoimqG6YtKXy7CSTW1Q= Received: (qmail 4963 invoked by alias); 11 Jun 2013 09:52: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 4939 invoked by uid 89); 11 Jun 2013 09:52:39 -0000 X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, SPF_PASS, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 11 Jun 2013 09:52:13 +0000 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r5B9q9G6030444 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Jun 2013 09:52:09 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r5B9qAPS019433 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 11 Jun 2013 09:52:11 GMT Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r5B9qAs0019420; Tue, 11 Jun 2013 09:52:10 GMT Received: from poldo4.casa (/79.47.195.82) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 11 Jun 2013 02:52:10 -0700 Message-ID: <51B6F348.4090600@oracle.com> Date: Tue, 11 Jun 2013 11:52:08 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: libstdc++ Subject: [v3] Fix libstdc++/56019 X-Virus-Found: No Hi, tested x86_64-linux, committed to mainline. Thanks, Paolo. //////////////////////// 2013-06-11 Paolo Carlini PR libstdc++/56019 * include/c_global/cstddef (max_align_t): Add to namespace std. * include/c_std/cstddef: Likewise. * testsuite/18_support/max_align_t/requirements/1.cc: New. * testsuite/18_support/max_align_t/requirements/2.cc: Likewise. Index: include/c_global/cstddef =================================================================== --- include/c_global/cstddef (revision 199937) +++ include/c_global/cstddef (working copy) @@ -36,7 +36,20 @@ // ISO C++ 14882: 18.1 Types // +#ifndef _GLIBCXX_CSTDDEF +#define _GLIBCXX_CSTDDEF 1 + #pragma GCC system_header #include #include + +#if __cplusplus >= 201103L +namespace std +{ + // We handle size_t, ptrdiff_t, and nullptr_t in c++config.h. + using ::max_align_t; +} +#endif + +#endif // _GLIBCXX_CSTDDEF Index: include/c_std/cstddef =================================================================== --- include/c_std/cstddef (revision 199937) +++ include/c_std/cstddef (working copy) @@ -44,4 +44,12 @@ #include #include +#if __cplusplus >= 201103L +namespace std +{ + // We handle size_t, ptrdiff_t, and nullptr_t in c++config.h. + using ::max_align_t; +} #endif + +#endif // _GLIBCXX_CSTDDEF Index: testsuite/18_support/max_align_t/requirements/1.cc =================================================================== --- testsuite/18_support/max_align_t/requirements/1.cc (revision 0) +++ testsuite/18_support/max_align_t/requirements/1.cc (working copy) @@ -0,0 +1,23 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11" } +// +// Copyright (C) 2013 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 +// . + +#include + +std::max_align_t t; Index: testsuite/18_support/max_align_t/requirements/2.cc =================================================================== --- testsuite/18_support/max_align_t/requirements/2.cc (revision 0) +++ testsuite/18_support/max_align_t/requirements/2.cc (working copy) @@ -0,0 +1,24 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11" } +// +// Copyright (C) 2013 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 +// . + +#include +#include + +static_assert (std::is_pod::value, "");