PR c++/13663
* semantics.c (finish_for_expr): Check for unresolved overloaded
functions.
PR c++/13363
* g++.dg/expr/for1.C: New test.
From-SVN: r76659
2004-01-26 Mark Mitchell <mark@codesourcery.com>
+ PR c++/13663
+ * semantics.c (finish_for_expr): Check for unresolved overloaded
+ functions.
+
* class.c (add_method): Just check processing_template_decl to
determine whether or not we are within a template.
* decl2.c (maybe_retrofit_in_chrg): Likewise.
void
finish_for_expr (tree expr, tree for_stmt)
{
+ /* If EXPR is an overloaded function, issue an error; there is no
+ context available to use to perform overload resolution. */
+ if (expr && type_unknown_p (expr))
+ {
+ cxx_incomplete_type_error (expr, TREE_TYPE (expr));
+ expr = error_mark_node;
+ }
FOR_EXPR (for_stmt) = expr;
}
+2004-01-26 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13363
+ * g++.dg/expr/for1.C: New test.
+
2004-01-26 Fariborz Jahanian <fjahanian@apple.com>
PR middle-end/13779
--- /dev/null
+// PR c++/13663
+
+struct S {
+ void f();
+};
+
+void g(int);
+void g(double);
+
+void h () {
+ S s;
+ for (;;s.f); // { dg-error "" }
+ for (;;g); // { dg-error "" }
+}