From patchwork Tue Jun 15 19:22:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 55784 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 4D317B7DA5 for ; Wed, 16 Jun 2010 05:22:55 +1000 (EST) Received: (qmail 649 invoked by alias); 15 Jun 2010 19:22:51 -0000 Received: (qmail 640 invoked by uid 22791); 15 Jun 2010 19:22:50 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Jun 2010 19:22:45 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5FJMiso001393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 15 Jun 2010 15:22:44 -0400 Received: from [IPv6:::1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5FJMhue014281 for ; Tue, 15 Jun 2010 15:22:43 -0400 Message-ID: <4C17D303.7000906@redhat.com> Date: Tue, 15 Jun 2010 15:22:43 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100603 Lightning/1.0b1 Shredder/3.0.6pre MIME-Version: 1.0 To: gcc-patches List Subject: minor C++ PATCH to use DECL_IS_BUILTIN in duplicate_decls 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 An earlier patch of mine changed duplicate_decls to use DECL_SOURCE_LOCATION to test for built-in declarations. I later noticed that there's a DECL_IS_BUILTIN macro for this purpose. Tested x86_64-pc-linux-gnu, applied to trunk. commit ec21885ffe1b3288b2ae803fb50cf496dab76147 Author: Jason Merrill Date: Thu Jun 10 10:52:51 2010 -0400 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test DECL_SOURCE_LOCATION directly. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 3108f9d..9541252 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1295,7 +1295,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) /* Even if the types match, prefer the new declarations type for built-ins which have not been explicitly declared, for exception lists, etc... */ - else if (DECL_SOURCE_LOCATION (olddecl) == BUILTINS_LOCATION) + else if (DECL_IS_BUILTIN (olddecl)) { tree type = TREE_TYPE (newdecl); tree attribs = (*targetm.merge_type_attributes)