Fix open solaris build issue with concept checking that breaks std vector for a class of itself. Bug #9523.

This commit is contained in:
Bill Hoffman 2009-09-14 10:31:38 -04:00
parent da29eb892b
commit 6a9a958591
2 changed files with 32 additions and 9 deletions

View File

@ -52,8 +52,8 @@ void cmDependsJavaParserHelper::CurrentClass
rname += this->Name;
files->push_back(rname);
std::vector<CurrentClass>::iterator it;
for ( it = this->NestedClasses.begin();
it != this->NestedClasses.end();
for ( it = this->NestedClasses->begin();
it != this->NestedClasses->end();
++ it )
{
it->AddFileNamesForPrinting(files, rname.c_str(), sep);
@ -249,7 +249,7 @@ void cmDependsJavaParserHelper::EndClass()
abort();
}
this->CurrentDepth --;
parent->NestedClasses.push_back(*current);
parent->NestedClasses->push_back(*current);
this->ClassStack.erase(this->ClassStack.end()-1, this->ClassStack.end());
}
@ -275,8 +275,8 @@ std::vector<cmStdString> cmDependsJavaParserHelper::GetFilesProduced()
std::vector<cmStdString> files;
CurrentClass* toplevel = &(*(this->ClassStack.begin()));
std::vector<CurrentClass>::iterator it;
for ( it = toplevel->NestedClasses.begin();
it != toplevel->NestedClasses.end();
for ( it = toplevel->NestedClasses->begin();
it != toplevel->NestedClasses->end();
++ it )
{
it->AddFileNamesForPrinting(&files, 0, "$");

View File

@ -70,14 +70,37 @@ public:
private:
class CurrentClass
{
{
public:
cmStdString Name;
std::vector<CurrentClass> NestedClasses;
CurrentClass() {}
std::vector<CurrentClass>* NestedClasses;
CurrentClass()
{
this->NestedClasses = new std::vector<CurrentClass>;
}
~CurrentClass()
{
delete this->NestedClasses;
}
CurrentClass& operator=(CurrentClass const& c)
{
this->NestedClasses->clear();
this->Name = c.Name;
std::copy(
c.NestedClasses->begin(),
c.NestedClasses->end(),
std::back_inserter(
*this->NestedClasses)
);
return *this;
}
CurrentClass(CurrentClass const& c)
{
(*this) = c;
}
void AddFileNamesForPrinting(std::vector<cmStdString> *files,
const char* prefix, const char* sep);
};
};
cmStdString CurrentPackage;
cmStdString::size_type InputBufferPos;
cmStdString InputBuffer;