This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] minipatch to use bool in cp/typeck2.c
- From: neroden at twcny dot rr dot com (Nathanael Nerode)
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 1 Aug 2003 22:06:24 -0400
- Subject: [committed] minipatch to use bool in cp/typeck2.c
Small c90-stylin' patch. (Note that 'bool' is typedef'ed to 'char' when
necessary.)
Bootstrapped i686-pc-linux-gnu.
Committed as obvious.
(cp)
* typeck2.c (add_exception_specifier): Use 'bool' where appropriate.
Index: typeck2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck2.c,v
retrieving revision 1.142
diff -u -r1.142 typeck2.c
--- typeck2.c 4 Jul 2003 05:05:16 -0000 1.142
+++ typeck2.c 5 Jul 2003 19:35:59 -0000
@@ -1199,9 +1199,9 @@
tree
add_exception_specifier (tree list, tree spec, int complain)
{
- int ok;
+ bool ok;
tree core = spec;
- int is_ptr;
+ bool is_ptr;
int diag_type = -1; /* none */
if (spec == error_mark_node)
@@ -1216,16 +1216,16 @@
if (is_ptr || TREE_CODE (core) == REFERENCE_TYPE)
core = TREE_TYPE (core);
if (complain < 0)
- ok = 1;
+ ok = true;
else if (VOID_TYPE_P (core))
ok = is_ptr;
else if (TREE_CODE (core) == TEMPLATE_TYPE_PARM)
- ok = 1;
+ ok = true;
else if (processing_template_decl)
- ok = 1;
+ ok = true;
else
{
- ok = 1;
+ ok = true;
/* 15.4/1 says that types in an exception specifier must be complete,
but it seems more reasonable to only require this on definitions
and calls. So just give a pedwarn at this point; we will give an
--
Nathanael Nerode <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html