This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21413] New: bogus diagnostic from unidentified template
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 May 2005 10:16:58 -0000
- Subject: [Bug c++/21413] New: bogus diagnostic from unidentified template
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In:
#include <iterator>
template<typename T> void foo(int);
template<typename C> typename std::iterator_traits<C>::value_type foo(const C&);
int main() {
int s;
foo<float>(s);
}
you get:
~/ootbc/members/src$ g++ foo.cc
/mnt/export/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/bits/stl_iterator_base_types.h:
In instantiation of `std::iterator_traits<float>':
foo.cc:6: instantiated from here
/mnt/export/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/bits/stl_iterator_base_types.h:129:
error: `float' is not a class, struct, or union type
/mnt/export/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/bits/stl_iterator_base_types.h:130:
error: `float' is not a class, struct, or union type
/mnt/export/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/bits/stl_iterator_base_types.h:131:
error: `float' is not a class, struct, or union type
/mnt/export/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/bits/stl_iterator_base_types.h:132:
error: `float' is not a class, struct, or union type
/mnt/export/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/bits/stl_iterator_base_types.h:133:
error: `float' is not a class, struct, or union type
The call identifies the first overload, but you get a diagnostic from the second
overload which is not identified. If you remove the iterator_traits reference
from the return type (just 'void' or some other innocuous type) then the first
overload identifies successfully without diagnostic.
Ivan
--
Summary: bogus diagnostic from unidentified template
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21413