From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98897 invoked by alias); 29 Apr 2015 20:50: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 98887 invoked by uid 89); 29 Apr 2015 20:50:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_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, 29 Apr 2015 20:50:30 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 017BF8EFCF; Wed, 29 Apr 2015 20:50:28 +0000 (UTC) Received: from [10.10.116.51] ([10.10.116.51]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3TKoRnb020336; Wed, 29 Apr 2015 16:50:28 -0400 Message-ID: <5541440C.7010506@redhat.com> Date: Wed, 29 Apr 2015 21:07:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Markus Trippelsdorf CC: "H.J. Lu" , gcc-patches List Subject: Re: C++ PATCH for c++/50800 (ICE with may_alias and templates) References: <55391529.6090904@redhat.com> <553F9C40.7040101@redhat.com> <20150429114153.GA32249@x4> In-Reply-To: <20150429114153.GA32249@x4> Content-Type: multipart/mixed; boundary="------------080808020609030206000700" X-SW-Source: 2015-04/txt/msg01930.txt.bz2 This is a multi-part message in MIME format. --------------080808020609030206000700 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 140 On 04/29/2015 07:41 AM, Markus Trippelsdorf wrote: > I'm getting hundreds of new warnings when building LLVM, e.g.: Whoops. Fixed thus. --------------080808020609030206000700 Content-Type: text/x-patch; name="50800-3.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="50800-3.patch" Content-length: 1707 commit 7da5a68ba55cd49c46ff9ac547df59248bd90f7d Author: Jason Merrill Date: Wed Apr 29 16:04:08 2015 -0400 PR c++/50800 * tree.c (apply_identity_attributes): Fix handling of classes. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index d00f0d7..ec9be8c 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1187,6 +1187,13 @@ apply_identity_attributes (tree result, tree attribs, bool *remove_attributes) tree new_attribs = NULL_TREE; tree *p = &new_attribs; + if (OVERLOAD_TYPE_P (result)) + { + /* On classes and enums all attributes are ingrained. */ + gcc_assert (attribs == TYPE_ATTRIBUTES (result)); + return result; + } + for (tree a = attribs; a; a = TREE_CHAIN (a)) { const attribute_spec *as diff --git a/gcc/testsuite/g++.dg/cpp0x/alignas3.C b/gcc/testsuite/g++.dg/cpp0x/alignas3.C new file mode 100644 index 0000000..aa62e5a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alignas3.C @@ -0,0 +1,20 @@ +// PR c++/50800 +// { dg-do compile { target c++11 } } + +template struct A; +template struct A<_Up *> { typedef _Up type; }; +template struct B { typedef typename A::type type; }; +template struct C; +template struct C { + typedef typename B::type SimpleType; +}; +template struct D { typedef int ret_type; }; +template struct F { + typedef typename D::SimpleType>::ret_type ret_type; +}; +template typename F::ret_type cast(Y &); +class CompoundStmt; +class alignas(8) Stmt { + Stmt *Children[1]; + CompoundStmt *getBlock() const { cast(Children[0]); } +}; --------------080808020609030206000700--