diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index fe893b043dc..5e5b4c82134 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2004-03-20 Paolo Carlini + + * include/std/std_valarray.h: Document DR389 [Ready]. + * docs/html/ext/howto.html: Add an entry for DR389. + 2004-03-19 Michael Eager * config/cpu/mips/atomicity.h: Prevent reg loads between LL and diff --git a/libstdc++-v3/docs/html/ext/howto.html b/libstdc++-v3/docs/html/ext/howto.html index f17c6173c08..56806ca436d 100644 --- a/libstdc++-v3/docs/html/ext/howto.html +++ b/libstdc++-v3/docs/html/ext/howto.html @@ -479,6 +479,12 @@
Change the format string to "%.0Lf".
+
389: + Const overload of valarray::operator[] returns by value +
+
Change it to return a const T&. +
+
402: Wrong new expression in [some_]allocator::construct
diff --git a/libstdc++-v3/include/std/std_valarray.h b/libstdc++-v3/include/std/std_valarray.h index 1b078437452..b893b335415 100644 --- a/libstdc++-v3/include/std/std_valarray.h +++ b/libstdc++-v3/include/std/std_valarray.h @@ -214,20 +214,17 @@ namespace std operator= (const _Expr<_Dom,_Tp>&); // _lib.valarray.access_ element access: - // XXX: LWG to be resolved. /** * Return a reference to the i'th array element. * - * The C++ spec defines the const version to return Tp instead of - * the more useful const Tp&. This issue is being reviewed in DR389. - * * @param i Index of element to return. * @return Reference to the i'th element. */ - const _Tp& operator[](size_t) const; + _Tp& operator[](size_t); - /// Return a reference to the i'th array element. - _Tp& operator[](size_t); + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 389. Const overload of valarray::operator[] returns by value. + const _Tp& operator[](size_t) const; // _lib.valarray.sub_ subset operations: /**