]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/38472 (Wrong result type of ternary operator)
authorDodji Seketeli <dodji@redhat.com>
Mon, 5 Jan 2009 22:41:37 +0000 (22:41 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Mon, 5 Jan 2009 22:41:37 +0000 (23:41 +0100)
gcc/cp/ChangeLog:
2009-01-05  Dodji Seketeli  <dodji@redhat.com>

PR c++/38472
* typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
Promotion should be done only for integral or enumeration types.

gcc/testsuite/ChangeLog:
2009-01-05  Dodji Seketeli  <dodji@redhat.com>

PR c++/38472
* g++.dg/conversion/usual-arith-conv.C: New test.

From-SVN: r143101

gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog

index 7c5ae834cfd1f9e0f1e9f0e6c649a134d786c7d0..cc4fce11d63f0135851e87a5efc88ab660c0200f 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-05  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/38472
+       * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
+
 2009-01-05  Jason Merrill  <jason@redhat.com>
 
        PR c++/38701
index ed01c511f3c2354f08160edcf9f8a95263a0e01e..4be7a25835583384a5e7d81f248fc21d71d8982c 100644 (file)
@@ -403,7 +403,7 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2)
 
   /* Perform the integral promotions.  We do not promote real types here.  */
   if (INTEGRAL_OR_ENUMERATION_TYPE_P (t1)
-      && INTEGRAL_OR_ENUMERATION_TYPE_P (t1)) 
+      && INTEGRAL_OR_ENUMERATION_TYPE_P (t2))
     {
       t1 = type_promotes_to (t1);
       t2 = type_promotes_to (t2);
index 46d2881e5a8fc99ea921f904217275bbd5d91015..f401ff5e03a3d3d79ccab924ec0b7c5592588400 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-05  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/38472
+       * g++.dg/conversion/usual-arith-conv.C: New test.
+
 2009-01-05  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
        PR c/34911