clang 19.0.0git
Functions
TemplateBase.cpp File Reference
#include "clang/AST/TemplateBase.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/DependenceFlags.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/PrettyPrinter.h"
#include "clang/AST/TemplateName.h"
#include "clang/AST/Type.h"
#include "clang/AST/TypeLoc.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <optional>

Go to the source code of this file.

Functions

static void printIntegral (const TemplateArgument &TemplArg, raw_ostream &Out, const PrintingPolicy &Policy, bool IncludeType)
 Print a template integral argument value.
 
static unsigned getArrayDepth (QualType type)
 
static bool needsAmpersandOnTemplateArg (QualType paramType, QualType argType)
 
static const ValueDeclgetAsSimpleValueDeclRef (const ASTContext &Ctx, QualType T, const APValue &V)
 
template<typename T >
static const T & DiagTemplateArg (const T &DB, const TemplateArgument &Arg)
 

Function Documentation

◆ DiagTemplateArg()

template<typename T >
static const T & DiagTemplateArg ( const T &  DB,
const TemplateArgument Arg 
)
static

◆ getArrayDepth()

static unsigned getArrayDepth ( QualType  type)
static

◆ getAsSimpleValueDeclRef()

static const ValueDecl * getAsSimpleValueDeclRef ( const ASTContext Ctx,
QualType  T,
const APValue V 
)
static

◆ needsAmpersandOnTemplateArg()

static bool needsAmpersandOnTemplateArg ( QualType  paramType,
QualType  argType 
)
static

◆ printIntegral()

static void printIntegral ( const TemplateArgument TemplArg,
raw_ostream &  Out,
const PrintingPolicy Policy,
bool  IncludeType 
)
static

Print a template integral argument value.

Parameters
TemplArgthe TemplateArgument instance to print.
Outthe raw_ostream instance to use for printing.
Policythe printing policy for EnumConstantDecl printing.
IncludeTypeIf set, ensure that the type of the expression printed matches the type of the template argument.

Definition at line 57 of file TemplateBase.cpp.

References clang::Type::getAs(), clang::TemplateArgument::getAsIntegral(), clang::QualType::getAsString(), clang::Type::getCanonicalTypeInternal(), clang::TemplateArgument::getIntegralType(), clang::QualType::getTypePtr(), clang::Type::isAnyCharacterType(), clang::Type::isBooleanType(), clang::Type::isChar16Type(), clang::Type::isChar32Type(), clang::Type::isChar8Type(), clang::Type::isCharType(), clang::Type::isSpecificBuiltinType(), clang::Type::isWideCharType(), clang::PrintingPolicy::MSVCFormatting, clang::CharacterLiteral::print(), clang::T, and clang::PrintingPolicy::UseEnumerators.

Referenced by clang::TemplateArgument::print().