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]

[committed] Fix ICE with C++11 attributes (PR c++/71739)


Hi!

We ICE with C++11 attributes, because their TREE_PURPOSE is not
IDENTIFIER_NODE, but TREE_LIST.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
committed to trunk and 6.2 as obvious.

2016-07-04  Jakub Jelinek  <jakub@redhat.com>

	PR c++/71739
	* tree.c (attribute_value_equal): Use get_attribute_name instead of
	directly using TREE_PURPOSE.

	* g++.dg/cpp0x/pr71739.C: New test.

--- gcc/tree.c.jj	2016-06-24 12:59:22.000000000 +0200
+++ gcc/tree.c	2016-07-04 11:17:48.425814493 +0200
@@ -5009,7 +5009,7 @@ attribute_value_equal (const_tree attr1,
       && TREE_CODE (TREE_VALUE (attr2)) == TREE_LIST)
     {
       /* Handle attribute format.  */
-      if (is_attribute_p ("format", TREE_PURPOSE (attr1)))
+      if (is_attribute_p ("format", get_attribute_name (attr1)))
 	{
 	  attr1 = TREE_VALUE (attr1);
 	  attr2 = TREE_VALUE (attr2);
--- gcc/testsuite/g++.dg/cpp0x/pr71739.C.jj	2016-07-04 11:19:16.629676012 +0200
+++ gcc/testsuite/g++.dg/cpp0x/pr71739.C	2016-07-04 11:18:56.000000000 +0200
@@ -0,0 +1,5 @@
+// PR c++/71739
+// { dg-do compile { target c++11 } }
+
+template <int N> struct alignas(N) A;
+template <int N> struct alignas(N) A {};

	Jakub


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