This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: template map value_type bug
- To: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Subject: Re: template map value_type bug
- From: "Paul J. Lucas" <pjl at barefooters dot org>
- Date: Wed, 17 May 2000 16:56:27 -0700 (PDT)
- cc: bug-gcc at gnu dot org
On Thu, 18 May 2000, Martin v. Loewis wrote:
> > because "value_type" is not recognized as a type even though
> > "key_type" is. A declaration of C without using any templates
> > at all compiles correctly.
>
> Thanks for your bug report. This is not a bug in the compiler, but in
> your code. Compile with -pedantic to see that this is a g++ extension
> which only applies to key_type, as value_type is also known globally.
> Use typename to correct this code.
OK, I do this:
#include <map>
template< class T > class C : std::map< char const*, T > {
typedef std::map< char const*, T > map_type;
typedef map_type::value_type value_type;
void insert( value_type const & ); // line 7
};
and get:
$ g++ -c bug.c
bug.c:7: Internal compiler error 61.
bug.c:7: Please submit a full bug report.
bug.c:7: Internal compiler error:
bug.c:7: See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
- Paul