[AST] Give TemplateArgumentLoc a constexpr ctor.

This removes the thread-safe static from
clang::TemplateTemplateParmDecl::getDefaultArgument() const::None

llvm-svn: 293523
This commit is contained in:
Benjamin Kramer 2017-01-30 18:32:46 +00:00
parent 8f520a73b2
commit 5d4e7c089b
2 changed files with 4 additions and 11 deletions

View File

@ -119,10 +119,7 @@ private:
public:
/// \brief Construct an empty, invalid template argument.
TemplateArgument() {
TypeOrValue.Kind = Null;
TypeOrValue.V = 0;
}
constexpr TemplateArgument() : TypeOrValue({Null, 0}) {}
/// \brief Construct a template type argument.
TemplateArgument(QualType T, bool isNullPtr = false) {
@ -388,8 +385,8 @@ private:
};
public:
TemplateArgumentLocInfo();
constexpr TemplateArgumentLocInfo() : Template({nullptr, nullptr, 0, 0}) {}
TemplateArgumentLocInfo(TypeSourceInfo *TInfo) : Declarator(TInfo) {}
TemplateArgumentLocInfo(Expr *E) : Expression(E) {}
@ -433,7 +430,7 @@ class TemplateArgumentLoc {
TemplateArgumentLocInfo LocInfo;
public:
TemplateArgumentLoc() {}
constexpr TemplateArgumentLoc() {}
TemplateArgumentLoc(const TemplateArgument &Argument,
TemplateArgumentLocInfo Opaque)

View File

@ -453,10 +453,6 @@ LLVM_DUMP_METHOD void TemplateArgument::dump() const { dump(llvm::errs()); }
// TemplateArgumentLoc Implementation
//===----------------------------------------------------------------------===//
TemplateArgumentLocInfo::TemplateArgumentLocInfo() {
memset((void*)this, 0, sizeof(TemplateArgumentLocInfo));
}
SourceRange TemplateArgumentLoc::getSourceRange() const {
switch (Argument.getKind()) {
case TemplateArgument::Expression: