This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] libstdc++/31511


Hi,

tested x86-linux, committed to mainline.

Paolo.

//////////////
2007-04-08  Alexey Beshenov  <bav.272304@gmail.com>

	PR libstdc++/31511
	* include/c_global/cmath.tcc (__cmath_power): Use _Tp(1).
	* include/c_std/cmath.tcc (__cmath_power): Likewise.
Index: include/c_global/cmath.tcc
===================================================================
--- include/c_global/cmath.tcc	(revision 123629)
+++ include/c_global/cmath.tcc	(working copy)
@@ -1,6 +1,7 @@
 // -*- C++ -*- C math library.
 
-// Copyright (C) 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -42,7 +43,7 @@
     inline _Tp
     __cmath_power(_Tp __x, unsigned int __n)
     {
-      _Tp __y = __n % 2 ? __x : 1;
+      _Tp __y = __n % 2 ? __x : _Tp(1);
 
       while (__n >>= 1)
         {
Index: include/c_std/cmath.tcc
===================================================================
--- include/c_std/cmath.tcc	(revision 123629)
+++ include/c_std/cmath.tcc	(working copy)
@@ -1,6 +1,7 @@
 // -*- C++ -*- C math library.
 
-// Copyright (C) 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -42,7 +43,7 @@
     inline _Tp
     __cmath_power(_Tp __x, unsigned int __n)
     {
-      _Tp __y = __n % 2 ? __x : 1;
+      _Tp __y = __n % 2 ? __x : _Tp(1);
 
       while (__n >>= 1)
         {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]