2011-12-07 Jakub Jelinek <jakub@redhat.com>
+ PR c++/51429
+ * typeck2.c (cxx_incomplete_type_diagnostic): Don't
+ ICE if TREE_OPERAND (value, 1) is overloaded.
+
PR c++/51229
* decl.c (reshape_init_class): Complain if d->cur->index is
INTEGER_CST.
case OFFSET_TYPE:
bad_member:
- if (DECL_FUNCTION_MEMBER_P (TREE_OPERAND (value, 1))
- && ! flag_ms_extensions)
- emit_diagnostic (diag_kind, input_location, 0,
- "invalid use of member function "
- "(did you forget the %<()%> ?)");
- else
- emit_diagnostic (diag_kind, input_location, 0,
- "invalid use of member "
- "(did you forget the %<&%> ?)");
+ {
+ tree member = TREE_OPERAND (value, 1);
+ if (is_overloaded_fn (member))
+ member = get_first_fn (member);
+ if (DECL_FUNCTION_MEMBER_P (member)
+ && ! flag_ms_extensions)
+ emit_diagnostic (diag_kind, input_location, 0,
+ "invalid use of member function "
+ "(did you forget the %<()%> ?)");
+ else
+ emit_diagnostic (diag_kind, input_location, 0,
+ "invalid use of member "
+ "(did you forget the %<&%> ?)");
+ }
break;
case TEMPLATE_TYPE_PARM: