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
This commit is contained in:
Dodji Seketeli 2009-01-05 22:41:37 +00:00 committed by Dodji Seketeli
parent 5641785fdc
commit 6f9b088b5a
3 changed files with 11 additions and 1 deletions

View 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> 2009-01-05 Jason Merrill <jason@redhat.com>
PR c++/38701 PR c++/38701

View 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. */ /* 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);

View 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> 2009-01-05 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR c/34911 PR c/34911