https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70029

--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Hmm, both options sounds quite involved. Perhaps for stage4 we can simply drop
the sanity check and add yet another FIXME to the verifier? Alias.c is
relatively robust about walking to main variants so I can't think of wrong code
issue caused by this.

Honza

Index: tree.c
===================================================================
--- tree.c      (revision 234761)
+++ tree.c      (working copy)
@@ -13584,7 +13584,8 @@ 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 volated by C++ frontend as discussed in PR70029.  */
+  if (TYPE_MAIN_VARIANT (t) == t && ct && TYPE_MAIN_VARIANT (ct) != ct && 0)
    {
       error ("TYPE_CANONICAL of main variant is not main variant");
       debug_tree (ct);
Index: testsuite/g++.dg/torture/pr70029.C
===================================================================
--- testsuite/g++.dg/torture/pr70029.C  (revision 0)
+++ testsuite/g++.dg/torture/pr70029.C  (working copy)
@@ -0,0 +1,11 @@
+/* { 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;
+

Reply via email to