Skip to content
Snippets Groups Projects
Commit 9c34ee65 authored by Douglas Gregor's avatar Douglas Gregor
Browse files

Tweak the storage mechanism for a set of overloaded template names in

the TemplateName class. Nothing actually changes, but I find this less
objectionable (and it will factor into an upcoming change).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123508 91177308-0d34-0410-b5e6-96231b3b80d8
parent c7793c73
No related branches found
No related tags found
No related merge requests found
......@@ -38,18 +38,18 @@ class TemplateDecl;
class OverloadedTemplateStorage {
union {
unsigned Size;
NamedDecl *Storage[1];
void *PointerAlignment;
};
friend class ASTContext;
OverloadedTemplateStorage(unsigned Size) : Size(Size) {}
NamedDecl **getStorage() {
return &Storage[1];
return reinterpret_cast<NamedDecl **>(this + 1);
}
NamedDecl * const *getStorage() const {
return &Storage[1];
return reinterpret_cast<NamedDecl *const *>(this + 1);
}
public:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment