re PR c++/70029 (ICE with C++11 and -flto)
authorMarek Polacek <polacek@redhat.com>
Thu, 14 Apr 2016 16:51:16 +0000 (16:51 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 14 Apr 2016 16:51:16 +0000 (16:51 +0000)
PR c++/70029
* tree.c (verify_type): Disable the canonical type of main variant
check.

* g++.dg/torture/pr70029.C: New test.

Co-Authored-By: Jan Hubicka <hubicka@ucw.cz>
From-SVN: r234979

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

index e56d15bc40de5db00229b228ba9d365c6a139f3b..c4a0759cedc900cdc41f2b5febd4892d29fed42d 100644 (file)
@@ -1,3 +1,10 @@
+2016-04-14  Marek Polacek  <polacek@redhat.com>
+           Jan Hubicka  <hubicka@ucw.cz>
+
+       PR c++/70029
+       * tree.c (verify_type): Disable the canonical type of main variant
+       check.
+
 2016-04-14  Jason Merrill  <jason@redhat.com>
 
        * cfgexpand.c, expr.c: Revert previous change.
index b7c5d3c632ce9c69356cd24303c75ccafcf088b9..9cd0c6ce0e89b0eb946805420e8282808df813ce 100644 (file)
@@ -1,3 +1,9 @@
+2016-04-14  Marek Polacek  <polacek@redhat.com>
+           Jan Hubicka  <hubicka@ucw.cz>
+
+       PR c++/70029
+       * g++.dg/torture/pr70029.C: New test.
+
 2016-04-14  Martin Sebor  <msebor@redhat.com>
 
        * g++.dg/cpp1y/vla11.C: Avoid using attribute aligned to increase
diff --git a/gcc/testsuite/g++.dg/torture/pr70029.C b/gcc/testsuite/g++.dg/torture/pr70029.C
new file mode 100644 (file)
index 0000000..9592f0c
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/70029
+// { dg-do compile }
+// { dg-options "-std=c++11 -g -flto" }
+// { dg-require-effective-target lto }
+
+struct A
+{
+  A();
+  int foo() && __attribute__ ((__warn_unused_result__)) { return 0; }
+};
+
+A a;
index ed28429b1e1006384f6232f79b893a6fa3fac0ce..c64d7204acb831cfd6502e69ee7a4a3c5dd4a011 100644 (file)
@@ -13584,7 +13584,9 @@ verify_type (const_tree t)
       debug_tree (ct);
       error_found = true;
     }
-  if (TYPE_MAIN_VARIANT (t) == t && ct && TYPE_MAIN_VARIANT (ct) != ct)
+  /* FIXME: this is violated by the C++ FE as discussed in PR70029, when
+     FUNCTION_*_QUALIFIED flags are set.  */
+  if (0 && TYPE_MAIN_VARIANT (t) == t && ct && TYPE_MAIN_VARIANT (ct) != ct)
    {
       error ("TYPE_CANONICAL of main variant is not main variant");
       debug_tree (ct);