diff mbox

Small C++ PATCH to apply_late_template_attributes

Message ID 525F0B8A.4020306@redhat.com
State New
Headers show

Commit Message

Jason Merrill Oct. 16, 2013, 9:56 p.m. UTC
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.
diff mbox

Patch

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,