You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Duraid Madina (JIRA)" <ji...@apache.org> on 2005/12/27 12:23:32 UTC

[jira] Created: (STDCXX-89) bug in algorithm.cc

bug in algorithm.cc
-------------------

         Key: STDCXX-89
         URL: http://issues.apache.org/jira/browse/STDCXX-89
     Project: STDCXX
        Type: Bug
  Components: 25. Algorithms  
    Versions: 4.1.3    
 Environment: HP-UX 11.23, aCC: HP aC++/ANSI C B3910B A.06.06 [Nov 7 2005]
    Reporter: Duraid Madina


On both the released ("incubating") and current subversion trunk versions of stdcxx, I trip across the following - I think it is your bug: 

"/home/duraid/stdcxx/include/algorithm.cc", line 1180: error #2304: no instance of function "__rw::__rw_lt<_TypeT>::operator() [with _Type
T=std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::Glob
alValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>
::value_type]" matches the argument list
            argument types are: (std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalVa
lue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<l
lvm::GlobalValue *>>::pointer>::iterator_type>::value_type, const llvm::GlobalValue *const)
            object type is: __rw::__rw_lt<std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm:
:GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::al
locator<llvm::GlobalValue *>>::pointer>>::value_type>
          if (__comp (*__middle, __val)) {
              ^
          detected during instantiation of "_RandomAccessIter std::__lower_bound(_RandomAccessIter, _RandomAccessIter, const _TypeT &, _Co
mpare, _Dist *, std::random_access_iterator_tag) [with _RandomAccessIter=__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::alloc
ator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue 
*, std::allocator<llvm::GlobalValue *>>::pointer>, _TypeT=const llvm::GlobalValue *, _Compare=__rw::__rw_lt<std::iterator_traits<__rw::__r
w_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::
GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::value_type>, _Dist=std::iterat
or_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, st
d::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::difference_
type]"

Please see http://kinoko.c.u-tokyo.ac.jp/~duraid/stdcxxissues if you want to try and reproduce this. There, you will find the following files:

DataStructure.cpp: the code I'm trying to build (it is a part of LLVM, http://www.llvm.org)

Note: the problem is the const keyword on line 694 (const GlobalValue *V = Src[0]; ) - removing that keyword allows the file to be compiled, but I think the const keyword should be legal there.

algorithmcc_bug.i: (preprocessed source: you should be able to compile this with aCC as follows:

aCC -D__STDC_LIMIT_MACROS -AA -DNDEBUG -D_RWSTDDEBUG     -D_RWSTD_USE_CONFIG   +d  +w +W392 +W655 +W684 +W818 +W819 +W849 +W2193 +W2236 +W2261 +W2401 +W2487 +O2  -c algorithmcc_bug.i

compile_log: what I see when trying to compile DataStructure.cpp with the const keyword present (grep for the error #2304)

If you would like an account on the machine where I see this, just let me know!


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (STDCXX-89) compilation error on std::lower_bound() with Iterator::value_type != T

Posted by "Duraid Madina (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/STDCXX-89?page=comments#action_12362534 ] 

Duraid Madina commented on STDCXX-89:
-------------------------------------

Martin, many thanks for this - I think your simplification is a good idea. I will keep my eyes open for your commit and let you know how things go.



> compilation error on std::lower_bound<Iterator, T>() with Iterator::value_type != T
> -----------------------------------------------------------------------------------
>
>          Key: STDCXX-89
>          URL: http://issues.apache.org/jira/browse/STDCXX-89
>      Project: STDCXX
>         Type: Bug
>   Components: 25. Algorithms
>     Versions: 4.1.3
>  Environment: all
>     Reporter: Duraid Madina
>     Assignee: Martin Sebor
>  Attachments: stdcxx-comparison.patch
>
> On both the released ("incubating") and current subversion trunk versions of stdcxx, I trip across the following - I think it is your bug: 
> "/home/duraid/stdcxx/include/algorithm.cc", line 1180: error #2304: no instance of function "__rw::__rw_lt<_TypeT>::operator() [with _Type
> T=std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::Glob
> alValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>
> ::value_type]" matches the argument list
>             argument types are: (std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalVa
> lue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<l
> lvm::GlobalValue *>>::pointer>::iterator_type>::value_type, const llvm::GlobalValue *const)
>             object type is: __rw::__rw_lt<std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm:
> :GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::al
> locator<llvm::GlobalValue *>>::pointer>>::value_type>
>           if (__comp (*__middle, __val)) {
>               ^
>           detected during instantiation of "_RandomAccessIter std::__lower_bound(_RandomAccessIter, _RandomAccessIter, const _TypeT &, _Co
> mpare, _Dist *, std::random_access_iterator_tag) [with _RandomAccessIter=__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::alloc
> ator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue 
> *, std::allocator<llvm::GlobalValue *>>::pointer>, _TypeT=const llvm::GlobalValue *, _Compare=__rw::__rw_lt<std::iterator_traits<__rw::__r
> w_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::
> GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::value_type>, _Dist=std::iterat
> or_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, st
> d::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::difference_
> type]"
> Please see http://kinoko.c.u-tokyo.ac.jp/~duraid/stdcxxissues if you want to try and reproduce this. There, you will find the following files:
> DataStructure.cpp: the code I'm trying to build (it is a part of LLVM, http://www.llvm.org)
> Note: the problem is the const keyword on line 694 (const GlobalValue *V = Src[0]; ) - removing that keyword allows the file to be compiled, but I think the const keyword should be legal there.
> algorithmcc_bug.i: (preprocessed source: you should be able to compile this with aCC as follows:
> aCC -D__STDC_LIMIT_MACROS -AA -DNDEBUG -D_RWSTDDEBUG     -D_RWSTD_USE_CONFIG   +d  +w +W392 +W655 +W684 +W818 +W819 +W849 +W2193 +W2236 +W2261 +W2401 +W2487 +O2  -c algorithmcc_bug.i
> compile_log: what I see when trying to compile DataStructure.cpp with the const keyword present (grep for the error #2304)
> If you would like an account on the machine where I see this, just let me know!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (STDCXX-89) compilation error on std::lower_bound() with Iterator::value_type != T

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/STDCXX-89?page=comments#action_12361460 ] 

Martin Sebor commented on STDCXX-89:
------------------------------------

Note that the patch only fixes the problem when inline member templates are supported. The _RWSTD_NO_INLINE_MEMBER_TEMPLATES case (i.e., when member templatesare not supported at all) is not handled. Since the absence of member template support likely implies the lack of support for partial template specialization I'm not sure at this point how fix it there.

> compilation error on std::lower_bound<Iterator, T>() with Iterator::value_type != T
> -----------------------------------------------------------------------------------
>
>          Key: STDCXX-89
>          URL: http://issues.apache.org/jira/browse/STDCXX-89
>      Project: STDCXX
>         Type: Bug
>   Components: 25. Algorithms
>     Versions: 4.1.3
>  Environment: all
>     Reporter: Duraid Madina
>     Assignee: Martin Sebor
>  Attachments: stdcxx-comparison.patch
>
> On both the released ("incubating") and current subversion trunk versions of stdcxx, I trip across the following - I think it is your bug: 
> "/home/duraid/stdcxx/include/algorithm.cc", line 1180: error #2304: no instance of function "__rw::__rw_lt<_TypeT>::operator() [with _Type
> T=std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::Glob
> alValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>
> ::value_type]" matches the argument list
>             argument types are: (std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalVa
> lue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<l
> lvm::GlobalValue *>>::pointer>::iterator_type>::value_type, const llvm::GlobalValue *const)
>             object type is: __rw::__rw_lt<std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm:
> :GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::al
> locator<llvm::GlobalValue *>>::pointer>>::value_type>
>           if (__comp (*__middle, __val)) {
>               ^
>           detected during instantiation of "_RandomAccessIter std::__lower_bound(_RandomAccessIter, _RandomAccessIter, const _TypeT &, _Co
> mpare, _Dist *, std::random_access_iterator_tag) [with _RandomAccessIter=__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::alloc
> ator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue 
> *, std::allocator<llvm::GlobalValue *>>::pointer>, _TypeT=const llvm::GlobalValue *, _Compare=__rw::__rw_lt<std::iterator_traits<__rw::__r
> w_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::
> GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::value_type>, _Dist=std::iterat
> or_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, st
> d::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::difference_
> type]"
> Please see http://kinoko.c.u-tokyo.ac.jp/~duraid/stdcxxissues if you want to try and reproduce this. There, you will find the following files:
> DataStructure.cpp: the code I'm trying to build (it is a part of LLVM, http://www.llvm.org)
> Note: the problem is the const keyword on line 694 (const GlobalValue *V = Src[0]; ) - removing that keyword allows the file to be compiled, but I think the const keyword should be legal there.
> algorithmcc_bug.i: (preprocessed source: you should be able to compile this with aCC as follows:
> aCC -D__STDC_LIMIT_MACROS -AA -DNDEBUG -D_RWSTDDEBUG     -D_RWSTD_USE_CONFIG   +d  +w +W392 +W655 +W684 +W818 +W819 +W849 +W2193 +W2236 +W2261 +W2401 +W2487 +O2  -c algorithmcc_bug.i
> compile_log: what I see when trying to compile DataStructure.cpp with the const keyword present (grep for the error #2304)
> If you would like an account on the machine where I see this, just let me know!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (STDCXX-89) compilation error on std::lower_bound() with Iterator::value_type != T

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/STDCXX-89?page=all ]

Martin Sebor updated STDCXX-89:
-------------------------------

        Summary: compilation error on std::lower_bound<Iterator, T>() with Iterator::value_type != T  (was: bug in algorithm.cc)
    Environment: all  (was: HP-UX 11.23, aCC: HP aC++/ANSI C B3910B A.06.06 [Nov 7 2005])
      Assign To: Martin Sebor

> compilation error on std::lower_bound<Iterator, T>() with Iterator::value_type != T
> -----------------------------------------------------------------------------------
>
>          Key: STDCXX-89
>          URL: http://issues.apache.org/jira/browse/STDCXX-89
>      Project: STDCXX
>         Type: Bug
>   Components: 25. Algorithms
>     Versions: 4.1.3
>  Environment: all
>     Reporter: Duraid Madina
>     Assignee: Martin Sebor
>  Attachments: stdcxx-comparison.patch
>
> On both the released ("incubating") and current subversion trunk versions of stdcxx, I trip across the following - I think it is your bug: 
> "/home/duraid/stdcxx/include/algorithm.cc", line 1180: error #2304: no instance of function "__rw::__rw_lt<_TypeT>::operator() [with _Type
> T=std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::Glob
> alValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>
> ::value_type]" matches the argument list
>             argument types are: (std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalVa
> lue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<l
> lvm::GlobalValue *>>::pointer>::iterator_type>::value_type, const llvm::GlobalValue *const)
>             object type is: __rw::__rw_lt<std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm:
> :GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::al
> locator<llvm::GlobalValue *>>::pointer>>::value_type>
>           if (__comp (*__middle, __val)) {
>               ^
>           detected during instantiation of "_RandomAccessIter std::__lower_bound(_RandomAccessIter, _RandomAccessIter, const _TypeT &, _Co
> mpare, _Dist *, std::random_access_iterator_tag) [with _RandomAccessIter=__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::alloc
> ator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue 
> *, std::allocator<llvm::GlobalValue *>>::pointer>, _TypeT=const llvm::GlobalValue *, _Compare=__rw::__rw_lt<std::iterator_traits<__rw::__r
> w_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::
> GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::value_type>, _Dist=std::iterat
> or_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, st
> d::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::difference_
> type]"
> Please see http://kinoko.c.u-tokyo.ac.jp/~duraid/stdcxxissues if you want to try and reproduce this. There, you will find the following files:
> DataStructure.cpp: the code I'm trying to build (it is a part of LLVM, http://www.llvm.org)
> Note: the problem is the const keyword on line 694 (const GlobalValue *V = Src[0]; ) - removing that keyword allows the file to be compiled, but I think the const keyword should be legal there.
> algorithmcc_bug.i: (preprocessed source: you should be able to compile this with aCC as follows:
> aCC -D__STDC_LIMIT_MACROS -AA -DNDEBUG -D_RWSTDDEBUG     -D_RWSTD_USE_CONFIG   +d  +w +W392 +W655 +W684 +W818 +W819 +W849 +W2193 +W2236 +W2261 +W2401 +W2487 +O2  -c algorithmcc_bug.i
> compile_log: what I see when trying to compile DataStructure.cpp with the const keyword present (grep for the error #2304)
> If you would like an account on the machine where I see this, just let me know!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (STDCXX-89) compilation error on std::lower_bound() with Iterator::value_type != T

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/STDCXX-89?page=comments#action_12361456 ] 

Martin Sebor commented on STDCXX-89:
------------------------------------

Thanks for the patch! I agree with the proposed fix in concept but there is one important case that the patch doesn't take into account that we need to handle: the patch relies on partial specialization of class templates which may not be available with some older compilers (when the config macro _RWSTD_NO_PARTIAL_CLASS_SPEC is #defined). An example of one such compiler that is still in widespread use is MSVC 6.
In addition, I believe we can simplify the general case and reduce the number of specializations of the predicate forms of the algorithm(s) implicitly instantiated from the non-predicate form by making the __rw_lt template into an ordinary (non-template) class and parametrizing the operator() member function on the types of its arguments. I will commit the patch with this feature shortly -- please give it a try and let us know how it works out for you!

> compilation error on std::lower_bound<Iterator, T>() with Iterator::value_type != T
> -----------------------------------------------------------------------------------
>
>          Key: STDCXX-89
>          URL: http://issues.apache.org/jira/browse/STDCXX-89
>      Project: STDCXX
>         Type: Bug
>   Components: 25. Algorithms
>     Versions: 4.1.3
>  Environment: all
>     Reporter: Duraid Madina
>     Assignee: Martin Sebor
>  Attachments: stdcxx-comparison.patch
>
> On both the released ("incubating") and current subversion trunk versions of stdcxx, I trip across the following - I think it is your bug: 
> "/home/duraid/stdcxx/include/algorithm.cc", line 1180: error #2304: no instance of function "__rw::__rw_lt<_TypeT>::operator() [with _Type
> T=std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::Glob
> alValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>
> ::value_type]" matches the argument list
>             argument types are: (std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalVa
> lue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<l
> lvm::GlobalValue *>>::pointer>::iterator_type>::value_type, const llvm::GlobalValue *const)
>             object type is: __rw::__rw_lt<std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm:
> :GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::al
> locator<llvm::GlobalValue *>>::pointer>>::value_type>
>           if (__comp (*__middle, __val)) {
>               ^
>           detected during instantiation of "_RandomAccessIter std::__lower_bound(_RandomAccessIter, _RandomAccessIter, const _TypeT &, _Co
> mpare, _Dist *, std::random_access_iterator_tag) [with _RandomAccessIter=__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::alloc
> ator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue 
> *, std::allocator<llvm::GlobalValue *>>::pointer>, _TypeT=const llvm::GlobalValue *, _Compare=__rw::__rw_lt<std::iterator_traits<__rw::__r
> w_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::
> GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::value_type>, _Dist=std::iterat
> or_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, st
> d::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::difference_
> type]"
> Please see http://kinoko.c.u-tokyo.ac.jp/~duraid/stdcxxissues if you want to try and reproduce this. There, you will find the following files:
> DataStructure.cpp: the code I'm trying to build (it is a part of LLVM, http://www.llvm.org)
> Note: the problem is the const keyword on line 694 (const GlobalValue *V = Src[0]; ) - removing that keyword allows the file to be compiled, but I think the const keyword should be legal there.
> algorithmcc_bug.i: (preprocessed source: you should be able to compile this with aCC as follows:
> aCC -D__STDC_LIMIT_MACROS -AA -DNDEBUG -D_RWSTDDEBUG     -D_RWSTD_USE_CONFIG   +d  +w +W392 +W655 +W684 +W818 +W819 +W849 +W2193 +W2236 +W2261 +W2401 +W2487 +O2  -c algorithmcc_bug.i
> compile_log: what I see when trying to compile DataStructure.cpp with the const keyword present (grep for the error #2304)
> If you would like an account on the machine where I see this, just let me know!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (STDCXX-89) bug in algorithm.cc

Posted by "Duraid Madina (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/STDCXX-89?page=all ]

Duraid Madina updated STDCXX-89:
--------------------------------

    Attachment: stdcxx-comparison.patch

Here is a patch that fixes this issue - this is the only change to stdcxx required to get LLVM (http://www.llvm.org) building on HP-UX with aCC 6 (trying to use the ancient RW STL that HP continue to ship involves quite a bit more hack-and-slash.)


> bug in algorithm.cc
> -------------------
>
>          Key: STDCXX-89
>          URL: http://issues.apache.org/jira/browse/STDCXX-89
>      Project: STDCXX
>         Type: Bug
>   Components: 25. Algorithms
>     Versions: 4.1.3
>  Environment: HP-UX 11.23, aCC: HP aC++/ANSI C B3910B A.06.06 [Nov 7 2005]
>     Reporter: Duraid Madina
>  Attachments: stdcxx-comparison.patch
>
> On both the released ("incubating") and current subversion trunk versions of stdcxx, I trip across the following - I think it is your bug: 
> "/home/duraid/stdcxx/include/algorithm.cc", line 1180: error #2304: no instance of function "__rw::__rw_lt<_TypeT>::operator() [with _Type
> T=std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::Glob
> alValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>
> ::value_type]" matches the argument list
>             argument types are: (std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalVa
> lue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<l
> lvm::GlobalValue *>>::pointer>::iterator_type>::value_type, const llvm::GlobalValue *const)
>             object type is: __rw::__rw_lt<std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm:
> :GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::al
> locator<llvm::GlobalValue *>>::pointer>>::value_type>
>           if (__comp (*__middle, __val)) {
>               ^
>           detected during instantiation of "_RandomAccessIter std::__lower_bound(_RandomAccessIter, _RandomAccessIter, const _TypeT &, _Co
> mpare, _Dist *, std::random_access_iterator_tag) [with _RandomAccessIter=__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::alloc
> ator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue 
> *, std::allocator<llvm::GlobalValue *>>::pointer>, _TypeT=const llvm::GlobalValue *, _Compare=__rw::__rw_lt<std::iterator_traits<__rw::__r
> w_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::
> GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::value_type>, _Dist=std::iterat
> or_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, st
> d::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::difference_
> type]"
> Please see http://kinoko.c.u-tokyo.ac.jp/~duraid/stdcxxissues if you want to try and reproduce this. There, you will find the following files:
> DataStructure.cpp: the code I'm trying to build (it is a part of LLVM, http://www.llvm.org)
> Note: the problem is the const keyword on line 694 (const GlobalValue *V = Src[0]; ) - removing that keyword allows the file to be compiled, but I think the const keyword should be legal there.
> algorithmcc_bug.i: (preprocessed source: you should be able to compile this with aCC as follows:
> aCC -D__STDC_LIMIT_MACROS -AA -DNDEBUG -D_RWSTDDEBUG     -D_RWSTD_USE_CONFIG   +d  +w +W392 +W655 +W684 +W818 +W819 +W849 +W2193 +W2236 +W2261 +W2401 +W2487 +O2  -c algorithmcc_bug.i
> compile_log: what I see when trying to compile DataStructure.cpp with the const keyword present (grep for the error #2304)
> If you would like an account on the machine where I see this, just let me know!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (STDCXX-89) bug in algorithm.cc

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/STDCXX-89?page=comments#action_12361438 ] 

Martin Sebor commented on STDCXX-89:
------------------------------------

I think the problem you're running into is reproduced in the test case bellow. While the current standard is not 100% clear about this I agree that the test case should compile without an error. I believe library issue 270 (http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#270) makes it clear.

$ cat t.cpp && nice make t
#include <algorithm>

struct A { };
struct B { };

bool operator< (A, B) { return false; }

int main ()
{
    A a;
    std::lower_bound (&a, &a, B ());
}
eccp -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG    -D_RWSTD_USE_CONFIG -I/build/sebor/eccp-3.6-11s/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include  -A -x --template_directory=/build/sebor/eccp-3.6-11s/lib -g  --display_error_number --remarks --diag_suppress 193,236,340,401,261,479,487,678,679,815  t.cpp
"/build/sebor/dev/stdlib/include/algorithm.cc", line 1180: error #304: no
          instance of function "__rw::__rw_lt<_TypeT>::operator() [with
          _TypeT=std::iterator_traits<A *>::value_type]" matches the argument
          list
            argument types are: (A, const B)
            object type is: __rw::__rw_lt<std::iterator_traits<A
                      *>::value_type>
          if (__comp (*__middle, __val)) {
              ^
          detected during:
            instantiation of "_RandomAccessIter
                      std::__lower_bound(_RandomAccessIter, _RandomAccessIter,
                      const _TypeT &, _Compare, _Dist *,
                      std::random_access_iterator_tag) [with
                      _RandomAccessIter=A *, _TypeT=B,
                      _Compare=__rw::__rw_lt<std::iterator_traits<A
                      *>::value_type>, _Dist=std::iterator_traits<A
                      *>::difference_type]" 
            compilation of secondary translation unit
                      "/build/sebor/dev/stdlib/src/export.cpp"

1 error detected in the compilation of "t.cpp".
make: *** [t.o] Error 2

> bug in algorithm.cc
> -------------------
>
>          Key: STDCXX-89
>          URL: http://issues.apache.org/jira/browse/STDCXX-89
>      Project: STDCXX
>         Type: Bug
>   Components: 25. Algorithms
>     Versions: 4.1.3
>  Environment: HP-UX 11.23, aCC: HP aC++/ANSI C B3910B A.06.06 [Nov 7 2005]
>     Reporter: Duraid Madina
>  Attachments: stdcxx-comparison.patch
>
> On both the released ("incubating") and current subversion trunk versions of stdcxx, I trip across the following - I think it is your bug: 
> "/home/duraid/stdcxx/include/algorithm.cc", line 1180: error #2304: no instance of function "__rw::__rw_lt<_TypeT>::operator() [with _Type
> T=std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::Glob
> alValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>
> ::value_type]" matches the argument list
>             argument types are: (std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalVa
> lue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<l
> lvm::GlobalValue *>>::pointer>::iterator_type>::value_type, const llvm::GlobalValue *const)
>             object type is: __rw::__rw_lt<std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm:
> :GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::al
> locator<llvm::GlobalValue *>>::pointer>>::value_type>
>           if (__comp (*__middle, __val)) {
>               ^
>           detected during instantiation of "_RandomAccessIter std::__lower_bound(_RandomAccessIter, _RandomAccessIter, const _TypeT &, _Co
> mpare, _Dist *, std::random_access_iterator_tag) [with _RandomAccessIter=__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::alloc
> ator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue 
> *, std::allocator<llvm::GlobalValue *>>::pointer>, _TypeT=const llvm::GlobalValue *, _Compare=__rw::__rw_lt<std::iterator_traits<__rw::__r
> w_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::
> GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::value_type>, _Dist=std::iterat
> or_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, st
> d::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::difference_
> type]"
> Please see http://kinoko.c.u-tokyo.ac.jp/~duraid/stdcxxissues if you want to try and reproduce this. There, you will find the following files:
> DataStructure.cpp: the code I'm trying to build (it is a part of LLVM, http://www.llvm.org)
> Note: the problem is the const keyword on line 694 (const GlobalValue *V = Src[0]; ) - removing that keyword allows the file to be compiled, but I think the const keyword should be legal there.
> algorithmcc_bug.i: (preprocessed source: you should be able to compile this with aCC as follows:
> aCC -D__STDC_LIMIT_MACROS -AA -DNDEBUG -D_RWSTDDEBUG     -D_RWSTD_USE_CONFIG   +d  +w +W392 +W655 +W684 +W818 +W819 +W849 +W2193 +W2236 +W2261 +W2401 +W2487 +O2  -c algorithmcc_bug.i
> compile_log: what I see when trying to compile DataStructure.cpp with the const keyword present (grep for the error #2304)
> If you would like an account on the machine where I see this, just let me know!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (STDCXX-89) compilation error on std::lower_bound() with Iterator::value_type != T

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/STDCXX-89?page=all ]
     
Martin Sebor resolved STDCXX-89:
--------------------------------

    Fix Version: 4.1.4
     Resolution: Fixed

The patch has already been applied -- see: http://svn.apache.org/viewcvs?view=rev&rev=360214
I'm going to resolve this issue but will wait to close it until I hear from you.

> compilation error on std::lower_bound<Iterator, T>() with Iterator::value_type != T
> -----------------------------------------------------------------------------------
>
>          Key: STDCXX-89
>          URL: http://issues.apache.org/jira/browse/STDCXX-89
>      Project: STDCXX
>         Type: Bug
>   Components: 25. Algorithms
>     Versions: 4.1.3
>  Environment: all
>     Reporter: Duraid Madina
>     Assignee: Martin Sebor
>      Fix For: 4.1.4
>  Attachments: stdcxx-comparison.patch
>
> On both the released ("incubating") and current subversion trunk versions of stdcxx, I trip across the following - I think it is your bug: 
> "/home/duraid/stdcxx/include/algorithm.cc", line 1180: error #2304: no instance of function "__rw::__rw_lt<_TypeT>::operator() [with _Type
> T=std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::Glob
> alValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>
> ::value_type]" matches the argument list
>             argument types are: (std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalVa
> lue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<l
> lvm::GlobalValue *>>::pointer>::iterator_type>::value_type, const llvm::GlobalValue *const)
>             object type is: __rw::__rw_lt<std::iterator_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm:
> :GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::al
> locator<llvm::GlobalValue *>>::pointer>>::value_type>
>           if (__comp (*__middle, __val)) {
>               ^
>           detected during instantiation of "_RandomAccessIter std::__lower_bound(_RandomAccessIter, _RandomAccessIter, const _TypeT &, _Co
> mpare, _Dist *, std::random_access_iterator_tag) [with _RandomAccessIter=__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::alloc
> ator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue 
> *, std::allocator<llvm::GlobalValue *>>::pointer>, _TypeT=const llvm::GlobalValue *, _Compare=__rw::__rw_lt<std::iterator_traits<__rw::__r
> w_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, std::allocator<llvm::
> GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::value_type>, _Dist=std::iterat
> or_traits<__rw::__rw_debug_iter<std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>, std::vector<llvm::GlobalValue *, st
> d::allocator<llvm::GlobalValue *>>::pointer, std::vector<llvm::GlobalValue *, std::allocator<llvm::GlobalValue *>>::pointer>>::difference_
> type]"
> Please see http://kinoko.c.u-tokyo.ac.jp/~duraid/stdcxxissues if you want to try and reproduce this. There, you will find the following files:
> DataStructure.cpp: the code I'm trying to build (it is a part of LLVM, http://www.llvm.org)
> Note: the problem is the const keyword on line 694 (const GlobalValue *V = Src[0]; ) - removing that keyword allows the file to be compiled, but I think the const keyword should be legal there.
> algorithmcc_bug.i: (preprocessed source: you should be able to compile this with aCC as follows:
> aCC -D__STDC_LIMIT_MACROS -AA -DNDEBUG -D_RWSTDDEBUG     -D_RWSTD_USE_CONFIG   +d  +w +W392 +W655 +W684 +W818 +W819 +W849 +W2193 +W2236 +W2261 +W2401 +W2487 +O2  -c algorithmcc_bug.i
> compile_log: what I see when trying to compile DataStructure.cpp with the const keyword present (grep for the error #2304)
> If you would like an account on the machine where I see this, just let me know!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira