re PR c++/71739 (ICE on valid C++11 code: tree check: expected identifier_node, have...
authorJakub Jelinek <jakub@redhat.com>
Mon, 4 Jul 2016 17:31:38 +0000 (19:31 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 4 Jul 2016 17:31:38 +0000 (19:31 +0200)
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.

From-SVN: r237991

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr71739.C [new file with mode: 0644]
gcc/tree.c

index aa81753ce95f5aa570506ed878a0feef1eeaeb8e..35d27e5c39db2096867cf8921d47aea30556b962 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2016-07-04  Jiong Wang  <jiong.wang@arm.com>
 
        * config/aarch64/aarch64.h: Rename "ARMv8.1" to "ARMv8.1-A".
index 9066d0f3afe085aa3dbb79bd43d338935fa05dbf..9e819ac4ed25c6a1dadbc697f0794e0f618c07c8 100644 (file)
@@ -1,3 +1,8 @@
+2016-07-04  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/71739
+       * g++.dg/cpp0x/pr71739.C: New test.
+
 2016-07-04  Christophe Lyon  <christophe.lyon@linaro.org>
 
        * c-c++-common/asan/clone-test-1.c (main): Handle clone() failure.
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr71739.C b/gcc/testsuite/g++.dg/cpp0x/pr71739.C
new file mode 100644 (file)
index 0000000..b31a580
--- /dev/null
@@ -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 {};
index bc60190b33925ac4ea0890fddbe1871ff9de9066..22951118e4c47ad3936ec203cbdb1f0ac3d87f23 100644 (file)
@@ -5009,7 +5009,7 @@ attribute_value_equal (const_tree attr1, const_tree attr2)
       && 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);