This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch c++]: Fix PR/47211 - ICE: in cp_build_addr_expr_1, at cp/typeck.c:4866 with -fms-extensions


On 01/08/2011 07:44 AM, Kai Tietz wrote:
-      if (!flag_ms_extensions && TREE_CODE (TREE_TYPE (xarg)) == METHOD_TYPE
+      if (flag_ms_extensions && TREE_CODE (TREE_TYPE (xarg)) == METHOD_TYPE
+          && !PTRMEM_OK_P (xarg) && TREE_CODE (xarg) == OFFSET_REF)
+	{
+	  if (TREE_CODE (TREE_TYPE (xarg)) == METHOD_TYPE
+	      && TYPE_P (TREE_OPERAND (xarg, 0)))
+	    PTRMEM_OK_P (xarg) = 1;
+	}

This doesn't look like the right change; we should give the same error that we gave in 3.4. The case we want to reject is trying to take the address of a bound pointer to member, i.e. the case where operand 1 of the OFFSET_REF is not a member.


Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]