diff options
Diffstat (limited to 'include/clang/Sema/ParsedTemplate.h')
-rw-r--r-- | include/clang/Sema/ParsedTemplate.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/clang/Sema/ParsedTemplate.h b/include/clang/Sema/ParsedTemplate.h index 9e1a616..1f572e5 100644 --- a/include/clang/Sema/ParsedTemplate.h +++ b/include/clang/Sema/ParsedTemplate.h @@ -139,6 +139,9 @@ namespace clang { /// tokens. All of the information about template arguments is allocated /// directly after this structure. struct TemplateIdAnnotation { + /// \brief The nested-name-specifier that precedes the template name. + CXXScopeSpec SS; + /// TemplateNameLoc - The location of the template name within the /// source. SourceLocation TemplateNameLoc; @@ -174,10 +177,13 @@ namespace clang { static TemplateIdAnnotation* Allocate(unsigned NumArgs) { TemplateIdAnnotation *TemplateId - = (TemplateIdAnnotation *)std::malloc(sizeof(TemplateIdAnnotation) + + = (TemplateIdAnnotation *)std::malloc(sizeof(TemplateIdAnnotation) + sizeof(ParsedTemplateArgument) * NumArgs); TemplateId->NumArgs = NumArgs; + // Default-construct nested-name-specifier. + new (&TemplateId->SS) CXXScopeSpec(); + // Default-construct parsed template arguments. ParsedTemplateArgument *TemplateArgs = TemplateId->getTemplateArgs(); for (unsigned I = 0; I != NumArgs; ++I) @@ -186,7 +192,10 @@ namespace clang { return TemplateId; } - void Destroy() { free(this); } + void Destroy() { + SS.~CXXScopeSpec(); + free(this); + } }; /// Retrieves the range of the given template parameter lists. |