PR C++/29295
* typeck.c (build_unary_op): Use same_type_p when comparing to
boolean type.
2006-10-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/29295
* g++.dg/expr/bool1.C: New test.
* g++.dg/expr/bool2.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118118
138bc75d-0d04-0410-961f-
82ee72b054a4
+2006-10-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR C++/29295
+ * typeck.c (build_unary_op): Use same_type_p when comparing to
+ boolean type.
+
2006-10-29 Dirk Mueller <dmueller@suse.de>
PR c++/29033
return error_mark_node;
/* Forbid using -- on `bool'. */
- if (TREE_TYPE (arg) == boolean_type_node)
+ if (same_type_p (TREE_TYPE (arg), boolean_type_node))
{
if (code == POSTDECREMENT_EXPR || code == PREDECREMENT_EXPR)
{
+2006-10-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR C++/29295
+ * g++.dg/expr/bool1.C: New test.
+ * g++.dg/expr/bool2.C: New test.
+
2006-10-28 Tobias Burnus <burnus@net-b.de>
PR fortran/28224
--- /dev/null
+// { dg-do run }
+// PR C++/29295
+// make sure that a typedef for a bool will have the
+// the same results as a bool itself.
+
+extern "C" void abort();
+typedef bool my_bool;
+int main()
+{
+ my_bool b = false;
+ int i;
+
+ b++;
+ b++;
+ i = b;
+ if (i != 1)
+ abort ();
+ return 0;
+}
+
+
--- /dev/null
+// { dg-do compile }
+// make sure that a typedef for a bool will have the
+// the same results as a bool itself.
+
+
+typedef bool my_bool;
+int main()
+{
+ my_bool b = false;
+ b--; // { dg-error "" }
+ return 0;
+}
+