diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-09-14 14:31:38 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-09-14 14:31:38 (GMT) |
commit | 6a9a958591e91d416ec330777f9692082961ff04 (patch) | |
tree | fb5100568a43272b631d0c867d3f5ceee77c7ea5 /Source | |
parent | da29eb892bff37d6f338d4fc154bb4df4a04244c (diff) | |
download | CMake-6a9a958591e91d416ec330777f9692082961ff04.zip CMake-6a9a958591e91d416ec330777f9692082961ff04.tar.gz CMake-6a9a958591e91d416ec330777f9692082961ff04.tar.bz2 |
Fix open solaris build issue with concept checking that breaks std vector for a class of itself. Bug #9523.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmDependsJavaParserHelper.cxx | 10 | ||||
-rw-r--r-- | Source/cmDependsJavaParserHelper.h | 31 |
2 files changed, 32 insertions, 9 deletions
diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index 64156bd..bb8130a 100644 --- a/Source/cmDependsJavaParserHelper.cxx +++ b/Source/cmDependsJavaParserHelper.cxx @@ -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, "$"); diff --git a/Source/cmDependsJavaParserHelper.h b/Source/cmDependsJavaParserHelper.h index 171518e..551e29b 100644 --- a/Source/cmDependsJavaParserHelper.h +++ b/Source/cmDependsJavaParserHelper.h @@ -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; |