This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: G++ Bug with option -pedantic
- To: kanze at gabi-soft dot de
- Subject: Re: G++ Bug with option -pedantic
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sun, 7 May 2000 23:24:22 +0200
- CC: gcc-bugs at gcc dot gnu dot org
- References: <200005072042.WAA28487@gabi-soft.de>
> The attached source doesn't compile with the -pedantic-errors option,
> at least under Windows. Even with the most pedantic interpretation
> possible, I don't see any error.
Thanks for your bug report. I believe there is indeed an error in your
code.
> vci.cc:22: parse error before `='
This line reads
std::vector< T >::const_iterator src = other.begin() ;
Since std::vector<T> is a dependent name, const_iterator is taken as
an expression here. Since you want it to be a type, you have to write
typename std::vector< T >::const_iterator src = other.begin() ;
This error shows up with -pedantic only, because that disables the gcc
extension that typename is added implicitly in some places that would
be compile errors otherwise.
Regards,
Martin