error: function "..." is not a type name

error: function "..." is not a type name

What's wrong with this program (it compiles with g++ 3.2.1, but reports an error on the UtSet::_Base typedef)

#include
template class UtSet: public std::set<_Key>{
public:
typedef std::set<_Key> _Base;
};

class Event;

class Mask {
public:
typedef UtSet EventPtrSet;
Mask() {}
~Mask() {}
EventPtrSet mEvents;
};

icc says

/tools/linux/icc7.0/bin/c++ -c /home/cds/apl/clean/src/shell/bad.cxx -o bad.o
/home/cds/apl/clean/src/shell/bad.cxx(7): error: function "std::_Tree<_Traits>::_Key [with _Traits=std::_Tset_traits, std::allocator, false>]" is not a type name
typedef std::set<_Key> _Base;
^
detected during instantiation of class "UtSet<_Key> [with _Key=Event *]" at line 19

-----------------
I tried sprinkling 'typename' keywords around without any visible impact.

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I tried your test case with latest Intel compiler, v7.0.86, available, and it worked.

Which version of compiler are you using?

Regards,
CP

[apl]aluminum$ icc -V
Intel C++ Compiler for 32-bit applications, Version 7.0 Build 20021021Z
Copyright (C) 1985-2002 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY

As I said your test case works with latest Intel compiler release. Please download it from Intel's premier site.

$icc -V
Intel C++ Compiler for 32-bit applications, Version 7.1 Build 20030307Z

Leave a Comment

Please sign in to add a comment. Not a member? Join today