[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mingw-users
Subject:    [Mingw-users] Class as an argument of a template instantiated in
From:       Basilevs <basilevs () ngs ! ru>
Date:       2009-01-25 13:52:21
Message-ID: 8ad2c27c0901250552t2756adb8v562fb09385e32d97 () mail ! gmail ! com
[Download RAW message or body]

The following code can't be compiled with alpha version of gcc 4.3
from mingw (complete version information is at the end of this
message).

Code:
----------------
#include <vector>
using namespace std;

class A {
	int a;
	typedef std::vector<A> As;
	typedef As::iterator Iter; //Removing this line solves the problem
};

int main (){
	A();
}
----------------

A removal of line:
typedef As::iterator Iter;
enables successful compilation of this test case.

All other versions of gcc compile this code without problems.


Full error report:
----------------
g++ -O0 -g3 -Wall -c -fmessage-length=0 -std=c++0x -omain.o ..\main.cpp
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/boost_concept_check.h:
In instantiation of '__gnu_cxx::_SGIAssignableConcept<A>':
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/stl_vector.h:179:
  instantiated from 'std::vector<A, std::allocator<A> >'
..\main.cpp:7:   instantiated from here
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/boost_concept_check.h:216:
error: '__gnu_cxx::_SGIAssignableConcept<_Tp>::__a' has incomplete
type
..\main.cpp:4: error: forward declaration of 'class A'
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/boost_concept_check.h:
In member function 'void
__gnu_cxx::_SGIAssignableConcept<_Tp>::__constraints() [with _Tp =
A]':
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/stl_vector.h:179:
  instantiated from 'std::vector<A, std::allocator<A> >'
..\main.cpp:7:   instantiated from here
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/boost_concept_check.h:208:
error: using invalid field
'__gnu_cxx::_SGIAssignableConcept<_Tp>::__a'
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/boost_concept_check.h:209:
error: using invalid field
'__gnu_cxx::_SGIAssignableConcept<_Tp>::__a'
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/boost_concept_check.h:209:
error: using invalid field
'__gnu_cxx::_SGIAssignableConcept<_Tp>::__a'
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/stl_vector.h:179:
  instantiated from 'std::vector<A, std::allocator<A> >'
..\main.cpp:7:   instantiated from here
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/boost_concept_check.h:210:
error: using invalid field
'__gnu_cxx::_SGIAssignableConcept<_Tp>::__a'
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/boost_concept_check.h:
In member function 'void
__gnu_cxx::_SGIAssignableConcept<_Tp>::__const_constraints(const _Tp&)
[with _Tp = A]':
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/boost_concept_check.h:210:
  instantiated from 'void
__gnu_cxx::_SGIAssignableConcept<_Tp>::__constraints() [with _Tp = A]'
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/stl_vector.h:179:
  instantiated from 'std::vector<A, std::allocator<A> >'
..\main.cpp:7:   instantiated from here
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/include/c++/bits/boost_concept_check.h:214:
error: using invalid field
'__gnu_cxx::_SGIAssignableConcept<_Tp>::__a'
Build error occurred, build is stopped
----------------

Version information:
----------------
>c:\mingw\bin\g++ -v
Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.3.0/configure
--enable-languages=c,ada,c++,fortran,java,objc,obj-c++
--disable-sjlj-exceptions --enable-shared --enable-libgcj
--enable-libgomp --with-dwarf2 --disable-win32-registry
--enable-libstdcxx-debug --enable-concept-checks
--enable-version-specific-runtime-libs --build=mingw32
--with-bugurl=http://www.mingw.org/bugs.shtml --prefix=/mingw
--with-gmp=/mingw/src/gcc/gmp-mpfr-root
--with-mpfr=/mingw/src/gcc/gmp-mpfr-root
--with-libiconv-prefix=/mingw/src/gcc/libiconv-root
Thread model: win32
gcc version 4.3.0 20080305 (alpha-testing) mingw-20080502 (GCC)
----------------
-- 
Гулевич Василий

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
MinGW-users mailing list
MinGW-users@lists.sourceforge.net

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

_______________________________________________
This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) HTML/MIME encoded mail
3) Improper quoting
4) Improper trimming

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic