Commit 874f88c4 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/90598 (Return type of explicit destructor call wrong)

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

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

From-SVN: r271752
parent 1585b483
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-29 Paolo Carlini <paolo.carlini@oracle.com> 2019-05-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/89875 PR c++/89875
......
...@@ -83,6 +83,10 @@ lvalue_kind (const_tree ref) ...@@ -83,6 +83,10 @@ lvalue_kind (const_tree ref)
if (ref == current_class_ptr) if (ref == current_class_ptr)
return clk_none; 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)) switch (TREE_CODE (ref))
{ {
case SAVE_EXPR: case SAVE_EXPR:
......
2019-05-29 Jakub Jelinek <jakub@redhat.com>
PR c++/90598
* g++.dg/cpp0x/pr90598.C: New test.
2019-05-29 Thomas Koenig <tkoenig@gcc.gnu.org> 2019-05-29 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/90539 PR fortran/90539
......
// 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;
// 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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment