diff --git a/clang/include/clang/Parse/RAIIObjectsForParser.h b/clang/include/clang/Parse/RAIIObjectsForParser.h index 36d87ebd8aca..0422b038da65 100644 --- a/clang/include/clang/Parse/RAIIObjectsForParser.h +++ b/clang/include/clang/Parse/RAIIObjectsForParser.h @@ -18,6 +18,7 @@ #include "clang/Parse/ParseDiagnostic.h" #include "clang/Parse/Parser.h" #include "clang/Sema/DelayedDiagnostic.h" +#include "clang/Sema/ParsedTemplate.h" #include "clang/Sema/Sema.h" namespace clang { @@ -442,6 +443,25 @@ namespace clang { void skipToEnd(); }; + /// \brief RAIIObject to destroy the contents of a SmallVector of + /// TemplateIdAnnotation pointers and clear the vector. + class DestroyTemplateIdAnnotationsRAIIObj { + SmallVectorImpl &Container; + + public: + DestroyTemplateIdAnnotationsRAIIObj( + SmallVectorImpl &Container) + : Container(Container) {} + + ~DestroyTemplateIdAnnotationsRAIIObj() { + for (SmallVectorImpl::iterator I = + Container.begin(), + E = Container.end(); + I != E; ++I) + (*I)->Destroy(); + Container.clear(); + } + }; } // end namespace clang #endif diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index c938cc9b5e41..08b7661a8a26 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -37,26 +37,6 @@ public: return false; } }; - -/// \brief RAIIObject to destroy the contents of a SmallVector of -/// TemplateIdAnnotation pointers and clear the vector. -class DestroyTemplateIdAnnotationsRAIIObj { - SmallVectorImpl &Container; - -public: - DestroyTemplateIdAnnotationsRAIIObj( - SmallVectorImpl &Container) - : Container(Container) {} - - ~DestroyTemplateIdAnnotationsRAIIObj() { - for (SmallVectorImpl::iterator I = - Container.begin(), - E = Container.end(); - I != E; ++I) - (*I)->Destroy(); - Container.clear(); - } -}; } // end anonymous namespace IdentifierInfo *Parser::getSEHExceptKeyword() {