aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-08-25 07:28:36 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-08-25 07:28:36 +0000
commitf22967f31a37794d2c0cd754c7ec2437530217d2 (patch)
treedeb6a046862e3bde00e49c3080c4a067b0da1f75 /gcc/cp
parent036cfb361a57d202ca5ea95d9551a20d1e1b5e91 (diff)
downloadgcc-f22967f31a37794d2c0cd754c7ec2437530217d2.zip
gcc-f22967f31a37794d2c0cd754c7ec2437530217d2.tar.gz
gcc-f22967f31a37794d2c0cd754c7ec2437530217d2.tar.bz2
decl.c (grokfndecl): Require that `main' return an `int'.
* decl.c (grokfndecl): Require that `main' return an `int'. * mangle.c (write_encoding): Don't mangle return types for conversion functions. From-SVN: r35972
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c5
-rw-r--r--gcc/cp/mangle.c1
3 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d0d7e0d..35612d8 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2000-08-25 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (grokfndecl): Require that `main' return an `int'.
+ * mangle.c (write_encoding): Don't mangle return types for
+ conversion functions.
+
2000-08-25 Gabriel Dos Reis <gdr@codesourcery.com>
* error.c (tree_formatting_info): New data type.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index f035f2f..613c44e 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8819,8 +8819,11 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
error ("cannot declare `::main' to be a template");
if (inlinep)
error ("cannot declare `::main' to be inline");
- else if (! publicp)
+ if (!publicp)
error ("cannot declare `::main' to be static");
+ if (!same_type_p (TREE_TYPE (TREE_TYPE (decl)),
+ integer_type_node))
+ error ("`main' must return `int'");
inlinep = 0;
publicp = 1;
}
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 9ca7178..0747ebc 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -643,6 +643,7 @@ write_encoding (decl)
write_bare_function_type (fn_type,
(!DECL_CONSTRUCTOR_P (decl)
&& !DECL_DESTRUCTOR_P (decl)
+ && !DECL_CONV_FN_P (decl)
&& decl_is_template_id (decl, NULL)));
}
}