]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/90598 (Return type of explicit destructor call wrong)
authorJakub Jelinek <jakub@redhat.com>
Wed, 5 Jun 2019 12:21:27 +0000 (14:21 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 5 Jun 2019 12:21:27 +0000 (14:21 +0200)
Backported from mainline
2019-05-29  Jakub Jelinek  <jakub@redhat.com>

PR c++/90598
* tree.c (lvalue_kind): Return clk_none for expressions with
with VOID_TYPE_P.

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

2019-05-02  Jonathan Wakely  <jwakely@redhat.com>

* testsuite/experimental/propagate_const/requirements2.cc: Adjust
dg-error.

From-SVN: r271959

gcc/cp/ChangeLog
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr90598.C [new file with mode: 0644]
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/experimental/propagate_const/requirements2.cc

index a0235a7dcbbeefbd0e3b290c3777c49d543faeef..ff5722cd9f202129a554aafe958669357323ec5f 100644 (file)
@@ -1,3 +1,12 @@
+2019-06-05  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2019-05-29  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/90598
+       * tree.c (lvalue_kind): Return clk_none for expressions with
+       with VOID_TYPE_P.
+
 2019-05-28  Marek Polacek  <polacek@redhat.com>
 
        Backported from mainline
index 718eed349c65f7eb78972dade3ebf7467ecb8719..1339e9fd204f38ae5f6b9f3765b98e9cf4a5e32a 100644 (file)
@@ -83,6 +83,10 @@ lvalue_kind (const_tree ref)
   if (ref == current_class_ptr)
     return clk_none;
 
+  /* Expressions with cv void type are prvalues.  */
+  if (TREE_TYPE (ref) && VOID_TYPE_P (TREE_TYPE (ref)))
+    return clk_none;
+
   switch (TREE_CODE (ref))
     {
     case SAVE_EXPR:
index 3f6a8aecab4e639acb3512576ded049ac1918a1b..2317d659f881711b1570fec7ad602422c3a7deb2 100644 (file)
@@ -1,3 +1,11 @@
+2019-06-05  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2019-05-29  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/90598
+       * g++.dg/cpp0x/pr90598.C: New test.
+
 2019-05-30  Iain Sandoe  <iain@sandoe.co.uk>
 
        Backport from mainline.
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr90598.C b/gcc/testsuite/g++.dg/cpp0x/pr90598.C
new file mode 100644 (file)
index 0000000..0ee3fb1
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/90598
+// { dg-do compile { target c++11 } }
+
+struct A {};
+using B = decltype(A ().~A ());
+template <typename T> struct C;
+template <> struct C<void> {};
+C<B> t;
index 0bc01f87010202f1484effc6d3465ac722424032..8d3a5c5ef0c79fb87b2447a68b98077f47e319aa 100644 (file)
@@ -1,3 +1,14 @@
+2019-06-05  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2019-05-29  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/90598
+       2019-05-02  Jonathan Wakely  <jwakely@redhat.com>
+
+       * testsuite/experimental/propagate_const/requirements2.cc: Adjust
+       dg-error.
+
 2019-06-03  Jonathan Wakely  <jwakely@redhat.com>
 
        PR libstdc++/90700
index 29b63eae67efa6e6516045a85f3de507932e7646..11d6bfd1b68a9c7763e39236dffe704529929026 100644 (file)
@@ -21,9 +21,8 @@
 
 using std::experimental::propagate_const;
 
-// { dg-error "requires a class or a pointer to an object type" "" { target *-*-* } 107 }
-// { dg-error "not a pointer-to-object type" "" { target *-*-* } 66 }
-// { dg-error "forming pointer to reference type" "" { target *-*-* } 187 }
-// { dg-error "forming pointer to reference type" "" { target *-*-* } 213 }
-
 propagate_const<void*> test1;
+
+// { dg-error "requires a class or a pointer to an object type" "" { target *-*-* } 0 }
+// { dg-prune-output "forming pointer to reference type" }
+// { dg-prune-output "not a pointer-to-object type" }