stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-976) std::uninitialized_copy() requires InputIterator::operator*() returning lvalue
Date Thu, 31 Jul 2008 15:18:31 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618716#action_12618716
] 

Martin Sebor commented on STDCXX-976:
-------------------------------------

It compiles fine with aCC 3.73. Unfortunately, after the patch compiler chokes on the regression
test for STDCXX-390: [20.specialized.stdcxx-390.cpp|http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/regress/20.specialized.stdcxx-390.cpp?view=markup]

{noformat}
aCC -c  -D_RWSTDDEBUG   -mt -I/tmp_mnt/amd/devco/sebor/stdcxx-4.2.x/include -I/build/sebor/stdcxx-4.2.x-aCC-3.73-15D/include
-I/tmp_mnt/amd/devco/sebor/stdcxx-4.2.x/tests/include  -AA  -g +d  +DD64 +w +W392,655,684,818,819,849
  /tmp_mnt/amd/devco/sebor/stdcxx-4.2.x/tests/regress/20.specialized.stdcxx-390.cpp
( 0)  0x002a6480   toolError__12ErrorHandlerF11StringTokenRC8Positione + 0x58  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
( 1)  0x00354640   fe_error + 0x24c  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
( 2)  0x0088b614   add_ELF_comdat_entry + 0x13c  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
( 3)  0x0088b690   collect_ELF_comdats + 0x4c  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
( 4)  0x0088e258   close_ELF_link + 0xa0  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
( 5)  0x000b7bc4   end_out + 0x3c  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
( 6)  0x001047b0   pass3_sllic + 0xf0  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
( 7)  0x001046b4   ccall_pass3 + 0x20  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
( 8)  0x00113bd0   process_sllic_graph + 0x1f0  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
( 9)  0x00281c30   finish_program + 0x94  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
(10)  0x00282ff4   cg_stp + 0x178  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
(11)  0x003773e4   be_stp + 0x1c  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
(12)  0x000b73ec   ucodeCodeGenTerm__Fv + 0x78  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
(13)  0x000cb7ac   main + 0x46c  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
(14)  0xc0143b00   _start + 0xc4  [/usr/lib/libc.2]
(15)  0x000b8120   $START$ + 0x178  [/tmp_mnt/amd/packages/mdx/hpux/compilers/hp/aCC373_11.11/opt/aCC/lbin/ctcom.pa20]
Error (internal problem) 7835: Exact position unknown; near
    ["/build/sebor/stdcxx-4.2.x-aCC-3.73-15D/include/config.h", line 805]. #
    Internal error encountered while generating ELF file. (7835)
gmake: *** [20.specialized.stdcxx-390.o] Error 3
{noformat}

> std::uninitialized_copy() requires InputIterator::operator*() returning lvalue
> ------------------------------------------------------------------------------
>
>                 Key: STDCXX-976
>                 URL: https://issues.apache.org/jira/browse/STDCXX-976
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 25. Algorithms
>    Affects Versions: 4.2.0, 4.2.1
>         Environment: All
>            Reporter: Farid Zaripov
>            Assignee: Farid Zaripov
>             Fix For: 4.2.2
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The following test fails to compile:
> {code}
> #include <memory>
> #include <iterator>
> struct InputIterator: std::iterator<std::input_iterator_tag, char>
> {
>     const char *p_;
>     InputIterator (const char *p): p_ (p) { }
>     InputIterator (const InputIterator &rhs): p_ (rhs.p_) { }
>     InputIterator& operator= (const InputIterator &rhs)
>     { p_ = rhs.p_; return *this; }
>     char operator* () const { return *p_; }
>     
>     InputIterator& operator++ () { return ++p_, *this; }
>     InputIterator operator++ (int) {
>         return ++p_, InputIterator (p_ - 1);
>     }
>     bool operator== (const InputIterator &rhs) const { return p_ == rhs.p_; }
>     bool operator!= (const InputIterator &rhs) const { return p_ != rhs.p_; }
> };
> int main ()
> {
>     char src [5] = "abcd";
>     char dst [5];
>     std::uninitialized_copy (InputIterator (src), InputIterator (src + 5), dst);
>     return 0;
> }
> {code}
> {noformat}
> D:\_Libs\stdcxx-4.2.2\include\rw\_specialized.h(168) : error C2665: '__rw::__rw_construct'
: none of the 2 overloads can convert parameter 2 from type 'char'
>         D:\_Libs\stdcxx-4.2.2\include\rw\_specialized.h(88): could be 'void __rw::__rw_construct<char,char>(_TypeT
*,_TypeU &)'
>         with
>         [
>             _TypeT=char,
>             _TypeU=char
>         ]
>         D:\_Libs\stdcxx-4.2.2\include\rw\_specialized.h(96): or       'void __rw::__rw_construct<char,char>(volatile
_TypeT *,_TypeU &)'
>         with
>         [
>             _TypeT=char,
>             _TypeU=char
>         ]
>         while trying to match the argument list '(char *, char)'
>         test.cpp(29) : see reference to function template instantiation '_ForwardIterator
std::uninitialized_copy<InputIterator,char*>(_InputIterator,_InputIterator,_ForwardIterator)'
being compiled
>         with
>         [
>             _ForwardIterator=char *,
>             _InputIterator=InputIterator
>         ]
> {noformat}
> The fix:
> {noformat}
> Index: include/rw/_specialized.h
> ===================================================================
> --- include/rw/_specialized.h	(revision 671890)
> +++ include/rw/_specialized.h	(working copy)
> @@ -85,7 +85,7 @@
>  
>  template <class _TypeT, class _TypeU>
>  inline void
> -__rw_construct (_TypeT* __p, _TypeU& __val)
> +__rw_construct (_TypeT* __p, const _TypeU& __val)
>  {
>      ::new (_RWSTD_STATIC_CAST (void*, __p)) _TypeT (__val);
>  }
> @@ -93,7 +93,7 @@
>  
>  template <class _TypeT, class _TypeU>
>  inline void
> -__rw_construct (volatile _TypeT* __p, _TypeU& __val)
> +__rw_construct (volatile _TypeT* __p, const _TypeU& __val)
>  {
>      // remove volatile before invoking operator new
>      __rw_construct (_RWSTD_CONST_CAST (_TypeT*, __p), __val);
> @@ -103,7 +103,7 @@
>  
>  template <class _TypeT, class _TypeU>
>  inline void
> -__rw_construct_impl (_TypeT* __p, _TypeU& __val)
> +__rw_construct_impl (_TypeT* __p, const _TypeU& __val)
>  {
>      ::new (_RWSTD_STATIC_CAST (void*, __p)) _TypeT (__val);
>  }
> @@ -111,7 +111,7 @@
>  
>  template <class _TypeT, class _TypeU>
>  inline void
> -__rw_construct (volatile _TypeT* __p, _TypeU& __val)
> +__rw_construct (volatile _TypeT* __p, const _TypeU& __val)
>  {
>      // remove volatile before invoking operator new
>      __rw_construct_impl (_RWSTD_CONST_CAST (_TypeT*, __p), __val);
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message