From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97745 invoked by alias); 25 Mar 2015 19:01:32 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 97726 invoked by uid 89); 25 Mar 2015 19:01:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 25 Mar 2015 19:01:30 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2PJ1S5A001436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 25 Mar 2015 15:01:28 -0400 Received: from redhat.com (ovpn-204-20.brq.redhat.com [10.40.204.20]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2PJ1Ntg015866 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Wed, 25 Mar 2015 15:01:27 -0400 Date: Wed, 25 Mar 2015 19:01:00 -0000 From: Marek Polacek To: GCC Patches , Jason Merrill Subject: C++ PATCH for c++/65558 (ICE with abi_tag on anon namespace) Message-ID: <20150325190123.GA21260@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-03/txt/msg01317.txt.bz2 As discussed in the PR, the abi_tag on an anonymous namespace is useless, but we shouldn't ICE if the user attempts to do that. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2015-03-25 Marek Polacek PR c++/65558 * name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute on an anonymous namespace. * g++.dg/cpp0x/pr65558.C: New test. diff --git gcc/cp/name-lookup.c gcc/cp/name-lookup.c index b85fbc9..4303ed5 100644 --- gcc/cp/name-lookup.c +++ gcc/cp/name-lookup.c @@ -3663,6 +3663,12 @@ handle_namespace_attrs (tree ns, tree attributes) "namespace", name); continue; } + if (!DECL_NAME (ns)) + { + warning (OPT_Wattributes, "ignoring %qD attribute on anonymous " + "namespace", name); + continue; + } if (!args) { tree dn = DECL_NAME (ns); diff --git gcc/testsuite/g++.dg/cpp0x/pr65558.C gcc/testsuite/g++.dg/cpp0x/pr65558.C index e69de29..5437e50 100644 --- gcc/testsuite/g++.dg/cpp0x/pr65558.C +++ gcc/testsuite/g++.dg/cpp0x/pr65558.C @@ -0,0 +1,6 @@ +// PR c++/65558 +// { dg-do compile { target c++11 } } + +inline namespace __attribute__((__abi_tag__)) +{ // { dg-warning "ignoring .__abi_tag__. attribute on anonymous namespace" } +} Marek