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

             Bug #: 55817
           Summary: void return value in std::vector<T>::insert() c++11
                    should be an iterator
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jobst.zieb...@mailbox.tu-dresden.de


Created attachment 29054
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29054
Preprocessed file as created by -save-temps

GCC version: 4.7.1
System type: Mac OS X 10.6.8 (i386-apple-darwin10.8.0)
GCC configure options: --prefix=/Users/JayZ/usr --enable-lto --enable-objc-gc
--disable-multilib
Error occurs by command: ~/usr/bin/g++ --std=c++11 insert_error.cpp

Error message (unfortunately in German - but message should be clear):
insert_error.cpp: In Funktion »int main()«:
insert_error.cpp:8:64: Fehler: Umwandlung von »void« in nicht-skalaren Typen
»std::vector<int>::iterator {aka __gnu_cxx::__normal_iterator<int*,
std::vector<int> >}« angefordert

 - A complaint about conversion from type "void" to type
"std::vector<int>::iterator"

Expected behaviour:
Flawless compilation and no error message.

As documented by the following websites:
 - "http://www.cplusplus.com/reference/vector/vector/insert/"; (C++11 section)
 - "http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf"; (page
726)

Unless I misread the c++11 library requirements (which I hope I didn't) this
seems to be an error in the "vector" implementation. The method insert() should
return an iterator.

Sincerely

Jobst Ziebell

Reply via email to