[Bug libstdc++/14926] New: libstdc++ rejects forward declarations.

vassili_bourdo at softhome dot net gcc-bugzilla@gcc.gnu.org
Mon Apr 12 17:57:00 GMT 2004


the code:

namespace std 
{
	template<class,class> class vector;//forward declaration
}

#include <vector>

int main()
{
	std::vector<int> v;
	return 0;
}

causes following compile-time error:

bug.cxx:2: error:   first declared as `template<class, class> struct 
std::vector' here
d:/tools/gcc/include/c++/3.4.0/bits/stl_vector.h:141: error:   also declared as 
`template<class _Tp, class _Alloc> class __gnu_norm::vector' here
bug.cxx:9: error: use of `vector' is ambiguous

-- 
           Summary: libstdc++ rejects forward declarations.
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vassili_bourdo at softhome dot net
                CC: gcc-bugs at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list