This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Small C++ PATCH to apply_late_template_attributes


While reviewing a recent patch I noticed that we weren't using attribute_takes_identifier_p here. Fixed.

Tested x86_64-pc-linux-gnu, applying to trunk.
commit 021fe309badd55090a5bc212c44d24b7c23f37af
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Oct 11 10:38:23 2013 -0400

    	* pt.c (apply_late_template_attributes): Use
    	attribute_takes_identifier_p.

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index a1eb7a2..e9c3ce2 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -8610,10 +8610,7 @@ apply_late_template_attributes (tree *decl_p, tree attributes, int attr_flags,
 		 pass it through tsubst.  Attributes like mode, format,
 		 cleanup and several target specific attributes expect it
 		 unmodified.  */
-	      else if (TREE_VALUE (t)
-		       && TREE_CODE (TREE_VALUE (t)) == TREE_LIST
-		       && TREE_VALUE (TREE_VALUE (t))
-		       && identifier_p (TREE_VALUE (TREE_VALUE (t))))
+	      else if (attribute_takes_identifier_p (TREE_PURPOSE (t)))
 		{
 		  tree chain
 		    = tsubst_expr (TREE_CHAIN (TREE_VALUE (t)), args, complain,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]