aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/call.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/ref-bind7.C13
4 files changed, 25 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4730d79..616a04b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-18 Marek Polacek <polacek@redhat.com>
+
+ PR c++/91962 - ICE with reference binding and qualification conversion.
+ * call.c (convert_like_real) <case ck_ref_bind>: Check need_temporary_p.
+
2019-11-17 Jakub Jelinek <jakub@redhat.com>
* method.c (lookup_comparison_result): Use %qD instead of %<%T::%D%>
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index e9ab30d..13639a1 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7598,7 +7598,8 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
/* direct_reference_binding might have inserted a ck_qual under
this ck_ref_bind for the benefit of conversion sequence ranking.
Ignore the conversion; we'll create our own below. */
- if (next_conversion (convs)->kind == ck_qual)
+ if (next_conversion (convs)->kind == ck_qual
+ && !convs->need_temporary_p)
{
gcc_assert (same_type_p (TREE_TYPE (expr),
next_conversion (convs)->type));
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c7e4500..d8bd2fa 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-18 Marek Polacek <polacek@redhat.com>
+
+ PR c++/91962 - ICE with reference binding and qualification conversion.
+ * g++.dg/cpp0x/ref-bind7.C: New test.
+
2019-11-18 Martin Jambor <mjambor@suse.cz>
PR ipa/92528
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-bind7.C b/gcc/testsuite/g++.dg/cpp0x/ref-bind7.C
new file mode 100644
index 0000000..e3675bc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-bind7.C
@@ -0,0 +1,13 @@
+// PR c++/91962 - ICE with reference binding and qualification conversion.
+// { dg-do compile { target c++11 } }
+
+template <typename a> class b {
+public:
+ void c(const a &);
+};
+class B {
+ void d();
+ b<const int *> e;
+};
+long f;
+void B::d() { e.c((const int *)f); }