Commit 6f9b088b by Dodji Seketeli Committed by Dodji Seketeli

re PR c++/38472 (Wrong result type of ternary operator)

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
parent 5641785f
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> 2009-01-05 Jason Merrill <jason@redhat.com>
PR c++/38701 PR c++/38701
......
...@@ -403,7 +403,7 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2) ...@@ -403,7 +403,7 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2)
/* Perform the integral promotions. We do not promote real types here. */ /* Perform the integral promotions. We do not promote real types here. */
if (INTEGRAL_OR_ENUMERATION_TYPE_P (t1) if (INTEGRAL_OR_ENUMERATION_TYPE_P (t1)
&& INTEGRAL_OR_ENUMERATION_TYPE_P (t1)) && INTEGRAL_OR_ENUMERATION_TYPE_P (t2))
{ {
t1 = type_promotes_to (t1); t1 = type_promotes_to (t1);
t2 = type_promotes_to (t2); t2 = type_promotes_to (t2);
......
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> 2009-01-05 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR c/34911 PR c/34911
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment