Blame SOURCES/gcc48-rh1344807.patch

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