diff options
Diffstat (limited to 'clang/include/clang/AST/DeclTemplate.h')
-rw-r--r-- | clang/include/clang/AST/DeclTemplate.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h index 60e0481944c..39b5208a662 100644 --- a/clang/include/clang/AST/DeclTemplate.h +++ b/clang/include/clang/AST/DeclTemplate.h @@ -460,12 +460,21 @@ public: /// friend void foo<>(T); /// }; /// \endcode -class LLVM_ALIGNAS(sizeof(void *)) DependentFunctionTemplateSpecializationInfo { - /// The number of potential template candidates. - unsigned NumTemplates; +class DependentFunctionTemplateSpecializationInfo { + struct CA { + /// The number of potential template candidates. + unsigned NumTemplates; - /// The number of template arguments. - unsigned NumArgs; + /// The number of template arguments. + unsigned NumArgs; + }; + + union { + // Force sizeof to be a multiple of sizeof(void*) so that the + // trailing data is aligned. + void *Aligner; + struct CA d; + }; /// The locations of the left and right angle brackets. SourceRange AngleLocs; @@ -481,7 +490,9 @@ public: /// \brief Returns the number of function templates that this might /// be a specialization of. - unsigned getNumTemplates() const { return NumTemplates; } + unsigned getNumTemplates() const { + return d.NumTemplates; + } /// \brief Returns the i'th template candidate. FunctionTemplateDecl *getTemplate(unsigned I) const { @@ -496,7 +507,9 @@ public: } /// \brief Returns the number of explicit template arguments that were given. - unsigned getNumTemplateArgs() const { return NumArgs; } + unsigned getNumTemplateArgs() const { + return d.NumArgs; + } /// \brief Returns the nth template argument. const TemplateArgumentLoc &getTemplateArg(unsigned I) const { |