summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/tr1
diff options
context:
space:
mode:
authorbergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-01 19:24:37 +0000
committerbergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-01 19:24:37 +0000
commitea1a58317a338c347e2017b851fdd3e0d2d5809b (patch)
treecd60a00f627c3f9f0d7d19e369f422b4c4290ae0 /libstdc++-v3/include/tr1
parentadf64732e878f2cf03558d7663c53ae3184a5661 (diff)
downloadppe42-gcc-ea1a58317a338c347e2017b851fdd3e0d2d5809b.tar.gz
ppe42-gcc-ea1a58317a338c347e2017b851fdd3e0d2d5809b.zip
gcc/cp/
PR c++/54537 * cp-tree.h: Check OVL_USED with OVERLOAD_CHECK. * name-lookup.c (do_nonmember_using_decl): Make sure we have an OVERLOAD before calling OVL_USED. Call diagnose_name_conflict instead of issuing an error without mentioning the conflicting declaration. libstdc++-v3/ PR c++/54537 * include/tr1/cmath: Remove pow(double,double) overload, remove a duplicated comment about DR 550. Add a comment to explain the issue. * testsuite/tr1/8_c_compatibility/cmath/pow_cmath.cc: New. gcc/testsuite/ PR c++/54537 * g++.dg/overload/using3.C: New. * g++.dg/overload/using2.C: Adjust. * g++.dg/lookup/using9.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201414 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/tr1')
-rw-r--r--libstdc++-v3/include/tr1/cmath19
1 files changed, 12 insertions, 7 deletions
diff --git a/libstdc++-v3/include/tr1/cmath b/libstdc++-v3/include/tr1/cmath
index 3658afb1d64..6e63e56b45e 100644
--- a/libstdc++-v3/include/tr1/cmath
+++ b/libstdc++-v3/include/tr1/cmath
@@ -846,10 +846,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
nexttoward(_Tp __x, long double __y)
{ return __builtin_nexttoward(__x, __y); }
- // DR 550. What should the return type of pow(float,int) be?
- // NB: C++0x and TR1 != C++03.
- // using std::pow;
-
inline float
remainder(float __x, float __y)
{ return __builtin_remainderf(__x, __y); }
@@ -985,9 +981,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// DR 550. What should the return type of pow(float,int) be?
// NB: C++0x and TR1 != C++03.
- inline double
- pow(double __x, double __y)
- { return std::pow(__x, __y); }
+
+ // The std::tr1::pow(double, double) overload cannot be provided
+ // here, because it would clash with ::pow(double,double) declared
+ // in <math.h>, if <tr1/math.h> is included at the same time (raised
+ // by the fix of PR c++/54537). It is not possible either to use the
+ // using-declaration 'using ::pow;' here, because if the user code
+ // has a 'using std::pow;', it would bring the pow(*,int) averloads
+ // in the tr1 namespace, which is undesirable. Consequently, the
+ // solution is to forward std::tr1::pow(double,double) to
+ // std::pow(double,double) via the templatized version below. See
+ // the discussion about this issue here:
+ // http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01278.html
inline float
pow(float __x, float __y)
OpenPOWER on IntegriCloud