2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
PR C++/23229
* decl.c (grokfndecl): Create a new function type
after erroring out about main not returning int.
2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
PR C++/23229
* g++.dg/warn/main-2.C: New test.
From-SVN: r105960
+2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/23229
+ * decl.c (grokfndecl): Create a new function type
+ after erroring out about main not returning int.
+
2005-10-28 Josh Conner <jconner@apple.com>
PR c++/22153
if (!same_type_p (TREE_TYPE (TREE_TYPE (decl)),
integer_type_node))
{
+ tree oldtypeargs = TYPE_ARG_TYPES (TREE_TYPE (decl));
+ tree newtype;
error ("%<::main%> must return %<int%>");
+ newtype = build_function_type (integer_type_node,
+ oldtypeargs);
+ TREE_TYPE (decl) = newtype;
TREE_TYPE (TREE_TYPE (decl)) = integer_type_node;
}
inlinep = 0;
+2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/23229
+ * g++.dg/warn/main-2.C: New test.
+
2005-10-28 Steven G. Kargl <kargls@comcast.net>
PR fortran/24545
--- /dev/null
+// { dg-do compile }
+// Make sure that the type of f1 does not change
+// after the error of main about not returning
+// int.
+// From Pekka Vuorela <pvuorela@iki.fi>
+// PR c++/23229
+
+void f1();
+
+void
+main() /* { dg-error "must return" } */
+{
+ f1();
+}
+
+void f1()
+{
+}
+