Blame SOURCES/gcc48-rh1344807.patch

22033d
2016-06-14  Jason Merrill  <jason@redhat.com>
22033d
22033d
	* call.c (add_function_candidate): Be more careful about
22033d
	ref-to-ptr conversion.
22033d
22033d
2016-06-15  Jakub Jelinek  <jakub@redhat.com>
22033d
22033d
	* g++.dg/cpp0x/ref-qual17.C: New test.
22033d
22033d
--- gcc/cp/call.c.jj	2014-08-06 10:45:03.260163142 +0200
22033d
+++ gcc/cp/call.c	2016-06-15 11:15:06.663878423 +0200
22033d
@@ -1975,7 +1975,9 @@ add_function_candidate (struct z_candida
22033d
 		  bool rv = FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (fn));
22033d
 		  parmtype = cp_build_reference_type (parmtype, rv);
22033d
 		  if (TREE_CODE (arg) == CONVERT_EXPR
22033d
-		      && TYPE_PTR_P (TREE_TYPE (arg)))
22033d
+		      && TYPE_PTR_P (TREE_TYPE (arg))
22033d
+		      && (TREE_CODE (TREE_TYPE (TREE_OPERAND (arg, 0)))
22033d
+			  == REFERENCE_TYPE))
22033d
 		    /* Strip conversion from reference to pointer.  */
22033d
 		    arg = TREE_OPERAND (arg, 0);
22033d
 		  arg = build_fold_indirect_ref (arg);
22033d
--- gcc/testsuite/g++.dg/cpp0x/ref-qual17.C.jj	2016-06-15 11:12:57.692558903 +0200
22033d
+++ gcc/testsuite/g++.dg/cpp0x/ref-qual17.C	2016-06-15 11:07:02.000000000 +0200
22033d
@@ -0,0 +1,12 @@
22033d
+// { dg-do compile { target c++11 } }
22033d
+
22033d
+struct A
22033d
+{
22033d
+  void foo () &;
22033d
+};
22033d
+
22033d
+void
22033d
+bar (__UINTPTR_TYPE__ a)
22033d
+{
22033d
+  reinterpret_cast(a)->foo ();
22033d
+}