This is the mail archive of the gcc-bugs@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]

[Bug libstdc++/11619] New: Improper warning when calling string::begin() on const string


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11619

           Summary: Improper warning when calling string::begin() on const
                    string
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bgrubi01 at eecs dot tufts dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: ppc-darwin
  GCC host triplet: ppc-darwin
GCC target triplet: ppc-darwin

In a function that takes a const string &foo, attempting to initialize a string::iterator bar to the 
result of foo.begin() generates the following warning:

/usr/include/gcc/darwin/3.3/c++/bits/stl_iterator.h: In constructor `
   __gnu_cxx::__normal_iterator<_Iterator, _Container>::__normal_iterator(const 
   __gnu_cxx::__normal_iterator<_Iter, _Container>&) [with _Iter = const char*, 
   _Iterator = char*, _Container = std::basic_string<char, 
   std::char_traits<char>, std::allocator<char> >]':
foo.cc:6:   instantiated from here
/usr/include/gcc/darwin/3.3/c++/bits/stl_iterator.h:595: warning: invalid 
   conversion from `const char* const' to `char*'


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