[cfe-commits] r123508 - /cfe/trunk/include/clang/AST/TemplateName.h
Douglas Gregor
dgregor at apple.com
Fri Jan 14 17:39:25 PST 2011
Author: dgregor
Date: Fri Jan 14 19:39:24 2011
New Revision: 123508
URL: http://llvm.org/viewvc/llvm-project?rev=123508&view=rev
Log:
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).
Modified:
cfe/trunk/include/clang/AST/TemplateName.h
Modified: cfe/trunk/include/clang/AST/TemplateName.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TemplateName.h?rev=123508&r1=123507&r2=123508&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/TemplateName.h (original)
+++ cfe/trunk/include/clang/AST/TemplateName.h Fri Jan 14 19:39:24 2011
@@ -38,18 +38,18 @@
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:
More information about the cfe-commits
mailing list