Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
Compiler
C++
Front End
access
Bitfields
Destructors
Diagnostics
Exception Handling
Extensions
Initialization
Inline Assembly
Invocation
Language
Mangling Scheme
Namespaces
Object Generation
Overloading
Pragmas
Pre-Compiled Headers
Preprocessor
Refactoring
RTTI
Templates
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/Compiler/C++/Front End/Templates
[ Add a report in this area ]
Report #:
68555
Status:
Withdrawn
Can't compile recursive struct with std::map member
Project:
C++Builder
Build #:
Update 1
Version:
12.0
Submitted By:
Johnny Willemsen
Report Type:
Crash / Data loss / Total failure
Date Reported:
11/4/2008 2:32:01 AM
Severity:
Critical / Show Stopper
Last Updated:
11/4/2008 3:40:00 AM
Platform:
All platforms
Internal Tracking #:
Resolution:
None
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
None
Description
Compile the code fragement in the steps part of this problem. You get the error below. This does compile with msvc8 and gcc without problems.
[BCC32 Error] utility(57): E2450 Undefined structure 'IdentifierTreeNode'
[BCC32 Error] xtree(36): E2450 Undefined structure 'std::pair<const std::string,IdentifierTreeNode>'
[BCC32 Error] xtree(53): E2029 'std::_Tree_nod<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' must be a previously defined class or struct
[BCC32 Error] xtree(75): E2029 'std::_Tree_ptr<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' must be a previously defined class or struct
[BCC32 Error] xtree(186): E2029 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' must be a previously defined class or struct
[BCC32 Error] xtree(115): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Node'
[BCC32 Error] xtree(116): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(119): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(120): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(137): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(142): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(147): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(152): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(157): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(162): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(167): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(215): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(336): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(342): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(373): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(980): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1071): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1091): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1168): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1185): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1190): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1210): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1217): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1224): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1229): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1234): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1254): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1288): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1312): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] xtree(1335): E2404 Dependent type qualifier 'std::_Tree_val<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' has no member type named '_Nodeptr'
[BCC32 Error] map(76): E2029 'std::_Tree<std::_Tmap_traits<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> >,0> >' must be a previously defined class or struct
[BCC32 Error] File1.cpp(22): E2450 Undefined structure 'std::map<std::string,IdentifierTreeNode,std::less<std::string>,std::allocator<std::pair<const std::string,IdentifierTreeNode> > >'
[BCC32 Error] File1.cpp(22): E2449 Size of 'map_' is unknown or zero
Steps to Reproduce:
//---------------------------------------------------------------------------
#pragma hdrstop
#include <tchar.h>
//---------------------------------------------------------------------------
#include <map>
#include <string>
struct IdentifierTreeNode
{
typedef
std::map<std::string, IdentifierTreeNode>
PrefixMap;
IdentifierTreeNode&
operator[] (char const* key)
{
return map_[key];
}
PrefixMap map_;
};
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
//---------------------------------------------------------------------------
Workarounds
None
Attachment
None
Comments
Johnny Willemsen at 11/4/2008 3:40:09 AM
-
withdrawn because this is illegal
http://www.ddj.com/cpp/184403814
Johnny Willemsen at 3/13/2009 1:57:03 AM
-
Ok, this is illegal, but CB2009 is the only compiler that has this restriction. Any possibilities to allow this code again?
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us