From patchwork Tue Jun 15 19:22:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: minor C++ PATCH to use DECL_IS_BUILTIN in duplicate_decls Date: Tue, 15 Jun 2010 09:22:43 -0000 From: Jason Merrill X-Patchwork-Id: 55784 Message-Id: <4C17D303.7000906@redhat.com> To: gcc-patches List 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)