зеркало из https://github.com/microsoft/clang-1.git
Move more stuff out of Sema.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112026 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
30ecc0ac0e
Коммит
2a7fb27913
|
@ -14,11 +14,13 @@
|
||||||
#ifndef LLVM_CLANG_SEMA_ANALYSIS_WARNINGS_H
|
#ifndef LLVM_CLANG_SEMA_ANALYSIS_WARNINGS_H
|
||||||
#define LLVM_CLANG_SEMA_ANALYSIS_WARNINGS_H
|
#define LLVM_CLANG_SEMA_ANALYSIS_WARNINGS_H
|
||||||
|
|
||||||
|
#include "clang/AST/Type.h"
|
||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
#include "llvm/ADT/DenseMap.h"
|
#include "llvm/ADT/DenseMap.h"
|
||||||
|
|
||||||
namespace clang {
|
namespace clang {
|
||||||
|
|
||||||
|
class FunctionDecl;
|
||||||
class Sema;
|
class Sema;
|
||||||
|
|
||||||
namespace sema {
|
namespace sema {
|
||||||
|
|
|
@ -567,19 +567,11 @@ private:
|
||||||
void configure();
|
void configure();
|
||||||
|
|
||||||
// Sanity checks.
|
// Sanity checks.
|
||||||
void sanity() const {
|
#ifndef NDEBUG
|
||||||
assert(ResultKind != NotFound || Decls.size() == 0);
|
void sanity() const;
|
||||||
assert(ResultKind != Found || Decls.size() == 1);
|
#else
|
||||||
assert(ResultKind != FoundOverloaded || Decls.size() > 1 ||
|
void sanity() const {}
|
||||||
(Decls.size() == 1 &&
|
#endif
|
||||||
isa<FunctionTemplateDecl>((*begin())->getUnderlyingDecl())));
|
|
||||||
assert(ResultKind != FoundUnresolvedValue || sanityCheckUnresolved());
|
|
||||||
assert(ResultKind != Ambiguous || Decls.size() > 1 ||
|
|
||||||
(Decls.size() == 1 && Ambiguity == AmbiguousBaseSubobjects));
|
|
||||||
assert((Paths != NULL) == (ResultKind == Ambiguous &&
|
|
||||||
(Ambiguity == AmbiguousBaseSubobjectTypes ||
|
|
||||||
Ambiguity == AmbiguousBaseSubobjects)));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool sanityCheckUnresolved() const {
|
bool sanityCheckUnresolved() const {
|
||||||
for (iterator I = begin(), E = end(); I != E; ++I)
|
for (iterator I = begin(), E = end(); I != E; ++I)
|
||||||
|
|
|
@ -114,7 +114,8 @@ namespace clang {
|
||||||
/// specified as separate members (rather than in an array) so that
|
/// specified as separate members (rather than in an array) so that
|
||||||
/// we can keep the size of a standard conversion sequence to a
|
/// we can keep the size of a standard conversion sequence to a
|
||||||
/// single word.
|
/// single word.
|
||||||
struct StandardConversionSequence {
|
class StandardConversionSequence {
|
||||||
|
public:
|
||||||
/// First -- The first conversion can be an lvalue-to-rvalue
|
/// First -- The first conversion can be an lvalue-to-rvalue
|
||||||
/// conversion, array-to-pointer conversion, or
|
/// conversion, array-to-pointer conversion, or
|
||||||
/// function-to-pointer conversion.
|
/// function-to-pointer conversion.
|
||||||
|
@ -324,7 +325,8 @@ namespace clang {
|
||||||
/// sequence, which may be a standard conversion sequence
|
/// sequence, which may be a standard conversion sequence
|
||||||
/// (C++ 13.3.3.1.1), user-defined conversion sequence (C++ 13.3.3.1.2),
|
/// (C++ 13.3.3.1.1), user-defined conversion sequence (C++ 13.3.3.1.2),
|
||||||
/// or an ellipsis conversion sequence (C++ 13.3.3.1.3).
|
/// or an ellipsis conversion sequence (C++ 13.3.3.1.3).
|
||||||
struct ImplicitConversionSequence {
|
class ImplicitConversionSequence {
|
||||||
|
public:
|
||||||
/// Kind - The kind of implicit conversion sequence. BadConversion
|
/// Kind - The kind of implicit conversion sequence. BadConversion
|
||||||
/// specifies that there is no conversion from the source type to
|
/// specifies that there is no conversion from the source type to
|
||||||
/// the target type. AmbiguousConversion represents the unique
|
/// the target type. AmbiguousConversion represents the unique
|
||||||
|
|
|
@ -16,16 +16,19 @@
|
||||||
#define LLVM_CLANG_SEMA_SEMA_H
|
#define LLVM_CLANG_SEMA_SEMA_H
|
||||||
|
|
||||||
#include "clang/Sema/Action.h"
|
#include "clang/Sema/Action.h"
|
||||||
#include "clang/Sema/IdentifierResolver.h"
|
|
||||||
#include "clang/Sema/CodeCompleteConsumer.h"
|
|
||||||
#include "clang/Sema/ObjCMethodList.h"
|
|
||||||
#include "clang/Sema/Overload.h"
|
|
||||||
#include "clang/Sema/AnalysisBasedWarnings.h"
|
#include "clang/Sema/AnalysisBasedWarnings.h"
|
||||||
|
#include "clang/Sema/CodeCompleteConsumer.h"
|
||||||
|
#include "clang/Sema/IdentifierResolver.h"
|
||||||
|
#include "clang/Sema/ObjCMethodList.h"
|
||||||
#include "clang/Sema/SemaDiagnostic.h"
|
#include "clang/Sema/SemaDiagnostic.h"
|
||||||
#include "llvm/ADT/SmallVector.h"
|
#include "clang/AST/Decl.h"
|
||||||
|
#include "clang/AST/DeclCXX.h"
|
||||||
|
#include "clang/AST/Expr.h"
|
||||||
|
#include "clang/AST/DeclarationName.h"
|
||||||
#include "llvm/ADT/DenseSet.h"
|
#include "llvm/ADT/DenseSet.h"
|
||||||
#include "llvm/ADT/SmallPtrSet.h"
|
|
||||||
#include "llvm/ADT/OwningPtr.h"
|
#include "llvm/ADT/OwningPtr.h"
|
||||||
|
#include "llvm/ADT/SmallPtrSet.h"
|
||||||
|
#include "llvm/ADT/SmallVector.h"
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -40,13 +43,19 @@ namespace clang {
|
||||||
class ArrayType;
|
class ArrayType;
|
||||||
class CXXBasePath;
|
class CXXBasePath;
|
||||||
class CXXBasePaths;
|
class CXXBasePaths;
|
||||||
|
class CXXConstructorDecl;
|
||||||
|
class CXXConversionDecl;
|
||||||
|
class CXXDestructorDecl;
|
||||||
class CXXFieldCollector;
|
class CXXFieldCollector;
|
||||||
|
class CXXMethodDecl;
|
||||||
class CXXTemporary;
|
class CXXTemporary;
|
||||||
class CXXTryStmt;
|
class CXXTryStmt;
|
||||||
class CallExpr;
|
class CallExpr;
|
||||||
class ClassTemplateDecl;
|
class ClassTemplateDecl;
|
||||||
class ClassTemplatePartialSpecializationDecl;
|
class ClassTemplatePartialSpecializationDecl;
|
||||||
|
class ClassTemplateSpecializationDecl;
|
||||||
class Decl;
|
class Decl;
|
||||||
|
class DeclAccessPair;
|
||||||
class DeclContext;
|
class DeclContext;
|
||||||
class DeclRefExpr;
|
class DeclRefExpr;
|
||||||
class DeclSpec;
|
class DeclSpec;
|
||||||
|
@ -55,8 +64,10 @@ namespace clang {
|
||||||
class Expr;
|
class Expr;
|
||||||
class ExtVectorType;
|
class ExtVectorType;
|
||||||
class ExternalSemaSource;
|
class ExternalSemaSource;
|
||||||
|
class FriendDecl;
|
||||||
class FunctionDecl;
|
class FunctionDecl;
|
||||||
class FunctionProtoType;
|
class FunctionProtoType;
|
||||||
|
class ImplicitConversionSequence;
|
||||||
class InitListExpr;
|
class InitListExpr;
|
||||||
class InitializationKind;
|
class InitializationKind;
|
||||||
class InitializationSequence;
|
class InitializationSequence;
|
||||||
|
@ -64,6 +75,7 @@ namespace clang {
|
||||||
class IntegerLiteral;
|
class IntegerLiteral;
|
||||||
class LabelStmt;
|
class LabelStmt;
|
||||||
class LangOptions;
|
class LangOptions;
|
||||||
|
class LocalInstantiationScope;
|
||||||
class LookupResult;
|
class LookupResult;
|
||||||
class MultiLevelTemplateArgumentList;
|
class MultiLevelTemplateArgumentList;
|
||||||
class NamedDecl;
|
class NamedDecl;
|
||||||
|
@ -79,17 +91,20 @@ namespace clang {
|
||||||
class ObjCMethodDecl;
|
class ObjCMethodDecl;
|
||||||
class ObjCPropertyDecl;
|
class ObjCPropertyDecl;
|
||||||
class ObjCProtocolDecl;
|
class ObjCProtocolDecl;
|
||||||
|
class OverloadCandidateSet;
|
||||||
class ParenListExpr;
|
class ParenListExpr;
|
||||||
class ParmVarDecl;
|
class ParmVarDecl;
|
||||||
class Preprocessor;
|
class Preprocessor;
|
||||||
class PseudoDestructorTypeStorage;
|
class PseudoDestructorTypeStorage;
|
||||||
class QualType;
|
class QualType;
|
||||||
|
class StandardConversionSequence;
|
||||||
class Stmt;
|
class Stmt;
|
||||||
class StringLiteral;
|
class StringLiteral;
|
||||||
class SwitchStmt;
|
class SwitchStmt;
|
||||||
class TargetAttributesSema;
|
class TargetAttributesSema;
|
||||||
class TemplateArgument;
|
class TemplateArgument;
|
||||||
class TemplateArgumentList;
|
class TemplateArgumentList;
|
||||||
|
class TemplateArgumentListBuilder;
|
||||||
class TemplateArgumentLoc;
|
class TemplateArgumentLoc;
|
||||||
class TemplateDecl;
|
class TemplateDecl;
|
||||||
class TemplateParameterList;
|
class TemplateParameterList;
|
||||||
|
@ -103,6 +118,11 @@ namespace clang {
|
||||||
class VarDecl;
|
class VarDecl;
|
||||||
class VisibleDeclConsumer;
|
class VisibleDeclConsumer;
|
||||||
|
|
||||||
|
namespace sema {
|
||||||
|
class AccessedEntity;
|
||||||
|
class TemplateDeductionInfo;
|
||||||
|
}
|
||||||
|
|
||||||
/// \brief Retains information about a function, method, or block that is
|
/// \brief Retains information about a function, method, or block that is
|
||||||
/// currently being parsed.
|
/// currently being parsed.
|
||||||
struct FunctionScopeInfo {
|
struct FunctionScopeInfo {
|
||||||
|
@ -942,14 +962,14 @@ public:
|
||||||
/// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
|
/// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
|
||||||
/// no declarator (e.g. "struct foo;") is parsed.
|
/// no declarator (e.g. "struct foo;") is parsed.
|
||||||
virtual Decl *ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
|
virtual Decl *ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
|
||||||
DeclSpec &DS);
|
DeclSpec &DS);
|
||||||
|
|
||||||
virtual Decl *BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
|
virtual Decl *BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
|
||||||
AccessSpecifier AS,
|
AccessSpecifier AS,
|
||||||
RecordDecl *Record);
|
RecordDecl *Record);
|
||||||
|
|
||||||
bool isAcceptableTagRedeclaration(const TagDecl *Previous,
|
bool isAcceptableTagRedeclaration(const TagDecl *Previous,
|
||||||
TagDecl::TagKind NewTag,
|
TagTypeKind NewTag,
|
||||||
SourceLocation NewTagLoc,
|
SourceLocation NewTagLoc,
|
||||||
const IdentifierInfo &Name);
|
const IdentifierInfo &Name);
|
||||||
|
|
||||||
|
@ -3285,93 +3305,10 @@ public:
|
||||||
TDK_FailedOverloadResolution
|
TDK_FailedOverloadResolution
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \brief Provides information about an attempted template argument
|
|
||||||
/// deduction, whose success or failure was described by a
|
|
||||||
/// TemplateDeductionResult value.
|
|
||||||
class TemplateDeductionInfo {
|
|
||||||
/// \brief The context in which the template arguments are stored.
|
|
||||||
ASTContext &Context;
|
|
||||||
|
|
||||||
/// \brief The deduced template argument list.
|
|
||||||
///
|
|
||||||
TemplateArgumentList *Deduced;
|
|
||||||
|
|
||||||
/// \brief The source location at which template argument
|
|
||||||
/// deduction is occurring.
|
|
||||||
SourceLocation Loc;
|
|
||||||
|
|
||||||
// do not implement these
|
|
||||||
TemplateDeductionInfo(const TemplateDeductionInfo&);
|
|
||||||
TemplateDeductionInfo &operator=(const TemplateDeductionInfo&);
|
|
||||||
|
|
||||||
public:
|
|
||||||
TemplateDeductionInfo(ASTContext &Context, SourceLocation Loc)
|
|
||||||
: Context(Context), Deduced(0), Loc(Loc) { }
|
|
||||||
|
|
||||||
~TemplateDeductionInfo() {
|
|
||||||
// FIXME: if (Deduced) Deduced->Destroy(Context);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \brief Returns the location at which template argument is
|
|
||||||
/// occuring.
|
|
||||||
SourceLocation getLocation() const {
|
|
||||||
return Loc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \brief Take ownership of the deduced template argument list.
|
|
||||||
TemplateArgumentList *take() {
|
|
||||||
TemplateArgumentList *Result = Deduced;
|
|
||||||
Deduced = 0;
|
|
||||||
return Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \brief Provide a new template argument list that contains the
|
|
||||||
/// results of template argument deduction.
|
|
||||||
void reset(TemplateArgumentList *NewDeduced) {
|
|
||||||
// FIXME: if (Deduced) Deduced->Destroy(Context);
|
|
||||||
Deduced = NewDeduced;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \brief The template parameter to which a template argument
|
|
||||||
/// deduction failure refers.
|
|
||||||
///
|
|
||||||
/// Depending on the result of template argument deduction, this
|
|
||||||
/// template parameter may have different meanings:
|
|
||||||
///
|
|
||||||
/// TDK_Incomplete: this is the first template parameter whose
|
|
||||||
/// corresponding template argument was not deduced.
|
|
||||||
///
|
|
||||||
/// TDK_Inconsistent: this is the template parameter for which
|
|
||||||
/// two different template argument values were deduced.
|
|
||||||
TemplateParameter Param;
|
|
||||||
|
|
||||||
/// \brief The first template argument to which the template
|
|
||||||
/// argument deduction failure refers.
|
|
||||||
///
|
|
||||||
/// Depending on the result of the template argument deduction,
|
|
||||||
/// this template argument may have different meanings:
|
|
||||||
///
|
|
||||||
/// TDK_Inconsistent: this argument is the first value deduced
|
|
||||||
/// for the corresponding template parameter.
|
|
||||||
///
|
|
||||||
/// TDK_SubstitutionFailure: this argument is the template
|
|
||||||
/// argument we were instantiating when we encountered an error.
|
|
||||||
///
|
|
||||||
/// TDK_NonDeducedMismatch: this is the template argument
|
|
||||||
/// provided in the source code.
|
|
||||||
TemplateArgument FirstArg;
|
|
||||||
|
|
||||||
/// \brief The second template argument to which the template
|
|
||||||
/// argument deduction failure refers.
|
|
||||||
///
|
|
||||||
/// FIXME: Finish documenting this.
|
|
||||||
TemplateArgument SecondArg;
|
|
||||||
};
|
|
||||||
|
|
||||||
TemplateDeductionResult
|
TemplateDeductionResult
|
||||||
DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial,
|
DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial,
|
||||||
const TemplateArgumentList &TemplateArgs,
|
const TemplateArgumentList &TemplateArgs,
|
||||||
TemplateDeductionInfo &Info);
|
sema::TemplateDeductionInfo &Info);
|
||||||
|
|
||||||
TemplateDeductionResult
|
TemplateDeductionResult
|
||||||
SubstituteExplicitTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
|
SubstituteExplicitTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
|
||||||
|
@ -3379,40 +3316,40 @@ public:
|
||||||
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced,
|
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced,
|
||||||
llvm::SmallVectorImpl<QualType> &ParamTypes,
|
llvm::SmallVectorImpl<QualType> &ParamTypes,
|
||||||
QualType *FunctionType,
|
QualType *FunctionType,
|
||||||
TemplateDeductionInfo &Info);
|
sema::TemplateDeductionInfo &Info);
|
||||||
|
|
||||||
TemplateDeductionResult
|
TemplateDeductionResult
|
||||||
FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate,
|
FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate,
|
||||||
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced,
|
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced,
|
||||||
unsigned NumExplicitlySpecified,
|
unsigned NumExplicitlySpecified,
|
||||||
FunctionDecl *&Specialization,
|
FunctionDecl *&Specialization,
|
||||||
TemplateDeductionInfo &Info);
|
sema::TemplateDeductionInfo &Info);
|
||||||
|
|
||||||
TemplateDeductionResult
|
TemplateDeductionResult
|
||||||
DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
|
DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
|
||||||
const TemplateArgumentListInfo *ExplicitTemplateArgs,
|
const TemplateArgumentListInfo *ExplicitTemplateArgs,
|
||||||
Expr **Args, unsigned NumArgs,
|
Expr **Args, unsigned NumArgs,
|
||||||
FunctionDecl *&Specialization,
|
FunctionDecl *&Specialization,
|
||||||
TemplateDeductionInfo &Info);
|
sema::TemplateDeductionInfo &Info);
|
||||||
|
|
||||||
TemplateDeductionResult
|
TemplateDeductionResult
|
||||||
DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
|
DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
|
||||||
const TemplateArgumentListInfo *ExplicitTemplateArgs,
|
const TemplateArgumentListInfo *ExplicitTemplateArgs,
|
||||||
QualType ArgFunctionType,
|
QualType ArgFunctionType,
|
||||||
FunctionDecl *&Specialization,
|
FunctionDecl *&Specialization,
|
||||||
TemplateDeductionInfo &Info);
|
sema::TemplateDeductionInfo &Info);
|
||||||
|
|
||||||
TemplateDeductionResult
|
TemplateDeductionResult
|
||||||
DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
|
DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
|
||||||
QualType ToType,
|
QualType ToType,
|
||||||
CXXConversionDecl *&Specialization,
|
CXXConversionDecl *&Specialization,
|
||||||
TemplateDeductionInfo &Info);
|
sema::TemplateDeductionInfo &Info);
|
||||||
|
|
||||||
TemplateDeductionResult
|
TemplateDeductionResult
|
||||||
DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
|
DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
|
||||||
const TemplateArgumentListInfo *ExplicitTemplateArgs,
|
const TemplateArgumentListInfo *ExplicitTemplateArgs,
|
||||||
FunctionDecl *&Specialization,
|
FunctionDecl *&Specialization,
|
||||||
TemplateDeductionInfo &Info);
|
sema::TemplateDeductionInfo &Info);
|
||||||
|
|
||||||
FunctionTemplateDecl *getMoreSpecializedTemplate(FunctionTemplateDecl *FT1,
|
FunctionTemplateDecl *getMoreSpecializedTemplate(FunctionTemplateDecl *FT1,
|
||||||
FunctionTemplateDecl *FT2,
|
FunctionTemplateDecl *FT2,
|
||||||
|
@ -3728,88 +3665,6 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \brief A stack-allocated class that identifies which local
|
|
||||||
/// variable declaration instantiations are present in this scope.
|
|
||||||
///
|
|
||||||
/// A new instance of this class type will be created whenever we
|
|
||||||
/// instantiate a new function declaration, which will have its own
|
|
||||||
/// set of parameter declarations.
|
|
||||||
class LocalInstantiationScope {
|
|
||||||
/// \brief Reference to the semantic analysis that is performing
|
|
||||||
/// this template instantiation.
|
|
||||||
Sema &SemaRef;
|
|
||||||
|
|
||||||
/// \brief A mapping from local declarations that occur
|
|
||||||
/// within a template to their instantiations.
|
|
||||||
///
|
|
||||||
/// This mapping is used during instantiation to keep track of,
|
|
||||||
/// e.g., function parameter and variable declarations. For example,
|
|
||||||
/// given:
|
|
||||||
///
|
|
||||||
/// \code
|
|
||||||
/// template<typename T> T add(T x, T y) { return x + y; }
|
|
||||||
/// \endcode
|
|
||||||
///
|
|
||||||
/// when we instantiate add<int>, we will introduce a mapping from
|
|
||||||
/// the ParmVarDecl for 'x' that occurs in the template to the
|
|
||||||
/// instantiated ParmVarDecl for 'x'.
|
|
||||||
llvm::DenseMap<const Decl *, Decl *> LocalDecls;
|
|
||||||
|
|
||||||
/// \brief The outer scope, which contains local variable
|
|
||||||
/// definitions from some other instantiation (that may not be
|
|
||||||
/// relevant to this particular scope).
|
|
||||||
LocalInstantiationScope *Outer;
|
|
||||||
|
|
||||||
/// \brief Whether we have already exited this scope.
|
|
||||||
bool Exited;
|
|
||||||
|
|
||||||
/// \brief Whether to combine this scope with the outer scope, such that
|
|
||||||
/// lookup will search our outer scope.
|
|
||||||
bool CombineWithOuterScope;
|
|
||||||
|
|
||||||
// This class is non-copyable
|
|
||||||
LocalInstantiationScope(const LocalInstantiationScope &);
|
|
||||||
LocalInstantiationScope &operator=(const LocalInstantiationScope &);
|
|
||||||
|
|
||||||
public:
|
|
||||||
LocalInstantiationScope(Sema &SemaRef, bool CombineWithOuterScope = false)
|
|
||||||
: SemaRef(SemaRef), Outer(SemaRef.CurrentInstantiationScope),
|
|
||||||
Exited(false), CombineWithOuterScope(CombineWithOuterScope)
|
|
||||||
{
|
|
||||||
SemaRef.CurrentInstantiationScope = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
~LocalInstantiationScope() {
|
|
||||||
Exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \brief Exit this local instantiation scope early.
|
|
||||||
void Exit() {
|
|
||||||
if (Exited)
|
|
||||||
return;
|
|
||||||
|
|
||||||
SemaRef.CurrentInstantiationScope = Outer;
|
|
||||||
Exited = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Decl *getInstantiationOf(const Decl *D);
|
|
||||||
|
|
||||||
VarDecl *getInstantiationOf(const VarDecl *Var) {
|
|
||||||
return cast<VarDecl>(getInstantiationOf(cast<Decl>(Var)));
|
|
||||||
}
|
|
||||||
|
|
||||||
ParmVarDecl *getInstantiationOf(const ParmVarDecl *Var) {
|
|
||||||
return cast<ParmVarDecl>(getInstantiationOf(cast<Decl>(Var)));
|
|
||||||
}
|
|
||||||
|
|
||||||
NonTypeTemplateParmDecl *getInstantiationOf(
|
|
||||||
const NonTypeTemplateParmDecl *Var) {
|
|
||||||
return cast<NonTypeTemplateParmDecl>(getInstantiationOf(cast<Decl>(Var)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void InstantiatedLocal(const Decl *D, Decl *Inst);
|
|
||||||
};
|
|
||||||
|
|
||||||
/// \brief The current instantiation scope used to store local
|
/// \brief The current instantiation scope used to store local
|
||||||
/// variables.
|
/// variables.
|
||||||
LocalInstantiationScope *CurrentInstantiationScope;
|
LocalInstantiationScope *CurrentInstantiationScope;
|
||||||
|
|
|
@ -157,6 +157,88 @@ namespace clang {
|
||||||
DeducedFromArrayBound = Deduced;
|
DeducedFromArrayBound = Deduced;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// \brief A stack-allocated class that identifies which local
|
||||||
|
/// variable declaration instantiations are present in this scope.
|
||||||
|
///
|
||||||
|
/// A new instance of this class type will be created whenever we
|
||||||
|
/// instantiate a new function declaration, which will have its own
|
||||||
|
/// set of parameter declarations.
|
||||||
|
class LocalInstantiationScope {
|
||||||
|
/// \brief Reference to the semantic analysis that is performing
|
||||||
|
/// this template instantiation.
|
||||||
|
Sema &SemaRef;
|
||||||
|
|
||||||
|
/// \brief A mapping from local declarations that occur
|
||||||
|
/// within a template to their instantiations.
|
||||||
|
///
|
||||||
|
/// This mapping is used during instantiation to keep track of,
|
||||||
|
/// e.g., function parameter and variable declarations. For example,
|
||||||
|
/// given:
|
||||||
|
///
|
||||||
|
/// \code
|
||||||
|
/// template<typename T> T add(T x, T y) { return x + y; }
|
||||||
|
/// \endcode
|
||||||
|
///
|
||||||
|
/// when we instantiate add<int>, we will introduce a mapping from
|
||||||
|
/// the ParmVarDecl for 'x' that occurs in the template to the
|
||||||
|
/// instantiated ParmVarDecl for 'x'.
|
||||||
|
llvm::DenseMap<const Decl *, Decl *> LocalDecls;
|
||||||
|
|
||||||
|
/// \brief The outer scope, which contains local variable
|
||||||
|
/// definitions from some other instantiation (that may not be
|
||||||
|
/// relevant to this particular scope).
|
||||||
|
LocalInstantiationScope *Outer;
|
||||||
|
|
||||||
|
/// \brief Whether we have already exited this scope.
|
||||||
|
bool Exited;
|
||||||
|
|
||||||
|
/// \brief Whether to combine this scope with the outer scope, such that
|
||||||
|
/// lookup will search our outer scope.
|
||||||
|
bool CombineWithOuterScope;
|
||||||
|
|
||||||
|
// This class is non-copyable
|
||||||
|
LocalInstantiationScope(const LocalInstantiationScope &);
|
||||||
|
LocalInstantiationScope &operator=(const LocalInstantiationScope &);
|
||||||
|
|
||||||
|
public:
|
||||||
|
LocalInstantiationScope(Sema &SemaRef, bool CombineWithOuterScope = false)
|
||||||
|
: SemaRef(SemaRef), Outer(SemaRef.CurrentInstantiationScope),
|
||||||
|
Exited(false), CombineWithOuterScope(CombineWithOuterScope)
|
||||||
|
{
|
||||||
|
SemaRef.CurrentInstantiationScope = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
~LocalInstantiationScope() {
|
||||||
|
Exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// \brief Exit this local instantiation scope early.
|
||||||
|
void Exit() {
|
||||||
|
if (Exited)
|
||||||
|
return;
|
||||||
|
|
||||||
|
SemaRef.CurrentInstantiationScope = Outer;
|
||||||
|
Exited = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Decl *getInstantiationOf(const Decl *D);
|
||||||
|
|
||||||
|
VarDecl *getInstantiationOf(const VarDecl *Var) {
|
||||||
|
return cast<VarDecl>(getInstantiationOf(cast<Decl>(Var)));
|
||||||
|
}
|
||||||
|
|
||||||
|
ParmVarDecl *getInstantiationOf(const ParmVarDecl *Var) {
|
||||||
|
return cast<ParmVarDecl>(getInstantiationOf(cast<Decl>(Var)));
|
||||||
|
}
|
||||||
|
|
||||||
|
NonTypeTemplateParmDecl *getInstantiationOf(
|
||||||
|
const NonTypeTemplateParmDecl *Var) {
|
||||||
|
return cast<NonTypeTemplateParmDecl>(getInstantiationOf(cast<Decl>(Var)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void InstantiatedLocal(const Decl *D, Decl *Inst);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LLVM_CLANG_SEMA_TEMPLATE_H
|
#endif // LLVM_CLANG_SEMA_TEMPLATE_H
|
||||||
|
|
|
@ -0,0 +1,111 @@
|
||||||
|
//===- TemplateDeduction.h - C++ template argument deduction ----*- C++ -*-===/
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//===----------------------------------------------------------------------===/
|
||||||
|
//
|
||||||
|
// This file provides types used with Sema's template argument deduction
|
||||||
|
// routines.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===/
|
||||||
|
#ifndef LLVM_CLANG_SEMA_TEMPLATE_DEDUCTION_H
|
||||||
|
#define LLVM_CLANG_SEMA_TEMPLATE_DEDUCTION_H
|
||||||
|
|
||||||
|
#include "clang/AST/DeclTemplate.h"
|
||||||
|
|
||||||
|
namespace clang {
|
||||||
|
|
||||||
|
class ASTContext;
|
||||||
|
class TemplateArgumentList;
|
||||||
|
|
||||||
|
namespace sema {
|
||||||
|
|
||||||
|
/// \brief Provides information about an attempted template argument
|
||||||
|
/// deduction, whose success or failure was described by a
|
||||||
|
/// TemplateDeductionResult value.
|
||||||
|
class TemplateDeductionInfo {
|
||||||
|
/// \brief The context in which the template arguments are stored.
|
||||||
|
ASTContext &Context;
|
||||||
|
|
||||||
|
/// \brief The deduced template argument list.
|
||||||
|
///
|
||||||
|
TemplateArgumentList *Deduced;
|
||||||
|
|
||||||
|
/// \brief The source location at which template argument
|
||||||
|
/// deduction is occurring.
|
||||||
|
SourceLocation Loc;
|
||||||
|
|
||||||
|
// do not implement these
|
||||||
|
TemplateDeductionInfo(const TemplateDeductionInfo&);
|
||||||
|
TemplateDeductionInfo &operator=(const TemplateDeductionInfo&);
|
||||||
|
|
||||||
|
public:
|
||||||
|
TemplateDeductionInfo(ASTContext &Context, SourceLocation Loc)
|
||||||
|
: Context(Context), Deduced(0), Loc(Loc) { }
|
||||||
|
|
||||||
|
~TemplateDeductionInfo() {
|
||||||
|
// FIXME: if (Deduced) Deduced->Destroy(Context);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// \brief Returns the location at which template argument is
|
||||||
|
/// occuring.
|
||||||
|
SourceLocation getLocation() const {
|
||||||
|
return Loc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// \brief Take ownership of the deduced template argument list.
|
||||||
|
TemplateArgumentList *take() {
|
||||||
|
TemplateArgumentList *Result = Deduced;
|
||||||
|
Deduced = 0;
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// \brief Provide a new template argument list that contains the
|
||||||
|
/// results of template argument deduction.
|
||||||
|
void reset(TemplateArgumentList *NewDeduced) {
|
||||||
|
// FIXME: if (Deduced) Deduced->Destroy(Context);
|
||||||
|
Deduced = NewDeduced;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// \brief The template parameter to which a template argument
|
||||||
|
/// deduction failure refers.
|
||||||
|
///
|
||||||
|
/// Depending on the result of template argument deduction, this
|
||||||
|
/// template parameter may have different meanings:
|
||||||
|
///
|
||||||
|
/// TDK_Incomplete: this is the first template parameter whose
|
||||||
|
/// corresponding template argument was not deduced.
|
||||||
|
///
|
||||||
|
/// TDK_Inconsistent: this is the template parameter for which
|
||||||
|
/// two different template argument values were deduced.
|
||||||
|
TemplateParameter Param;
|
||||||
|
|
||||||
|
/// \brief The first template argument to which the template
|
||||||
|
/// argument deduction failure refers.
|
||||||
|
///
|
||||||
|
/// Depending on the result of the template argument deduction,
|
||||||
|
/// this template argument may have different meanings:
|
||||||
|
///
|
||||||
|
/// TDK_Inconsistent: this argument is the first value deduced
|
||||||
|
/// for the corresponding template parameter.
|
||||||
|
///
|
||||||
|
/// TDK_SubstitutionFailure: this argument is the template
|
||||||
|
/// argument we were instantiating when we encountered an error.
|
||||||
|
///
|
||||||
|
/// TDK_NonDeducedMismatch: this is the template argument
|
||||||
|
/// provided in the source code.
|
||||||
|
TemplateArgument FirstArg;
|
||||||
|
|
||||||
|
/// \brief The second template argument to which the template
|
||||||
|
/// argument deduction failure refers.
|
||||||
|
///
|
||||||
|
/// FIXME: Finish documenting this.
|
||||||
|
TemplateArgument SecondArg;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -15,6 +15,7 @@
|
||||||
#include "clang/Sema/Sema.h"
|
#include "clang/Sema/Sema.h"
|
||||||
#include "clang/AST/DeclCXX.h"
|
#include "clang/AST/DeclCXX.h"
|
||||||
#include "clang/AST/DeclObjC.h"
|
#include "clang/AST/DeclObjC.h"
|
||||||
|
#include "clang/AST/DeclTemplate.h"
|
||||||
#include "clang/Lex/Preprocessor.h"
|
#include "clang/Lex/Preprocessor.h"
|
||||||
#include "clang-c/Index.h"
|
#include "clang-c/Index.h"
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
|
|
|
@ -12,8 +12,11 @@
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "clang/Sema/Sema.h"
|
#include "clang/Sema/Sema.h"
|
||||||
|
#include "clang/Sema/DeclSpec.h"
|
||||||
#include "clang/Sema/Initialization.h"
|
#include "clang/Sema/Initialization.h"
|
||||||
#include "clang/Sema/Lookup.h"
|
#include "clang/Sema/Lookup.h"
|
||||||
|
#include "clang/Sema/ParsedTemplate.h"
|
||||||
|
#include "clang/Sema/TemplateDeduction.h"
|
||||||
#include "clang/AST/ASTContext.h"
|
#include "clang/AST/ASTContext.h"
|
||||||
#include "clang/AST/CXXInheritance.h"
|
#include "clang/AST/CXXInheritance.h"
|
||||||
#include "clang/AST/DeclObjC.h"
|
#include "clang/AST/DeclObjC.h"
|
||||||
|
@ -23,10 +26,9 @@
|
||||||
#include "clang/Basic/PartialDiagnostic.h"
|
#include "clang/Basic/PartialDiagnostic.h"
|
||||||
#include "clang/Basic/TargetInfo.h"
|
#include "clang/Basic/TargetInfo.h"
|
||||||
#include "clang/Lex/Preprocessor.h"
|
#include "clang/Lex/Preprocessor.h"
|
||||||
#include "clang/Sema/DeclSpec.h"
|
|
||||||
#include "clang/Sema/ParsedTemplate.h"
|
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
using namespace clang;
|
using namespace clang;
|
||||||
|
using namespace sema;
|
||||||
|
|
||||||
ParsedType Sema::getDestructorName(SourceLocation TildeLoc,
|
ParsedType Sema::getDestructorName(SourceLocation TildeLoc,
|
||||||
IdentifierInfo &II,
|
IdentifierInfo &II,
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "clang/Sema/Lookup.h"
|
#include "clang/Sema/Lookup.h"
|
||||||
#include "clang/Sema/DeclSpec.h"
|
#include "clang/Sema/DeclSpec.h"
|
||||||
#include "clang/Sema/Scope.h"
|
#include "clang/Sema/Scope.h"
|
||||||
|
#include "clang/Sema/TemplateDeduction.h"
|
||||||
#include "clang/AST/ASTContext.h"
|
#include "clang/AST/ASTContext.h"
|
||||||
#include "clang/AST/CXXInheritance.h"
|
#include "clang/AST/CXXInheritance.h"
|
||||||
#include "clang/AST/Decl.h"
|
#include "clang/AST/Decl.h"
|
||||||
|
@ -36,6 +37,7 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace clang;
|
using namespace clang;
|
||||||
|
using namespace sema;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class UnqualUsingEntry {
|
class UnqualUsingEntry {
|
||||||
|
@ -288,6 +290,22 @@ void LookupResult::configure() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
void LookupResult::sanity() const {
|
||||||
|
assert(ResultKind != NotFound || Decls.size() == 0);
|
||||||
|
assert(ResultKind != Found || Decls.size() == 1);
|
||||||
|
assert(ResultKind != FoundOverloaded || Decls.size() > 1 ||
|
||||||
|
(Decls.size() == 1 &&
|
||||||
|
isa<FunctionTemplateDecl>((*begin())->getUnderlyingDecl())));
|
||||||
|
assert(ResultKind != FoundUnresolvedValue || sanityCheckUnresolved());
|
||||||
|
assert(ResultKind != Ambiguous || Decls.size() > 1 ||
|
||||||
|
(Decls.size() == 1 && Ambiguity == AmbiguousBaseSubobjects));
|
||||||
|
assert((Paths != NULL) == (ResultKind == Ambiguous &&
|
||||||
|
(Ambiguity == AmbiguousBaseSubobjectTypes ||
|
||||||
|
Ambiguity == AmbiguousBaseSubobjects)));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Necessary because CXXBasePaths is not complete in Sema.h
|
// Necessary because CXXBasePaths is not complete in Sema.h
|
||||||
void LookupResult::deletePaths(CXXBasePaths *Paths) {
|
void LookupResult::deletePaths(CXXBasePaths *Paths) {
|
||||||
delete Paths;
|
delete Paths;
|
||||||
|
@ -637,7 +655,7 @@ static bool LookupDirect(Sema &S, LookupResult &R, const DeclContext *DC) {
|
||||||
// result), perform template argument deduction and place the
|
// result), perform template argument deduction and place the
|
||||||
// specialization into the result set. We do this to avoid forcing all
|
// specialization into the result set. We do this to avoid forcing all
|
||||||
// callers to perform special deduction for conversion functions.
|
// callers to perform special deduction for conversion functions.
|
||||||
Sema::TemplateDeductionInfo Info(R.getSema().Context, R.getNameLoc());
|
TemplateDeductionInfo Info(R.getSema().Context, R.getNameLoc());
|
||||||
FunctionDecl *Specialization = 0;
|
FunctionDecl *Specialization = 0;
|
||||||
|
|
||||||
const FunctionProtoType *ConvProto
|
const FunctionProtoType *ConvProto
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "clang/Sema/Lookup.h"
|
#include "clang/Sema/Lookup.h"
|
||||||
#include "clang/Sema/Initialization.h"
|
#include "clang/Sema/Initialization.h"
|
||||||
#include "clang/Sema/Template.h"
|
#include "clang/Sema/Template.h"
|
||||||
|
#include "clang/Sema/TemplateDeduction.h"
|
||||||
#include "clang/Basic/Diagnostic.h"
|
#include "clang/Basic/Diagnostic.h"
|
||||||
#include "clang/Lex/Preprocessor.h"
|
#include "clang/Lex/Preprocessor.h"
|
||||||
#include "clang/AST/ASTContext.h"
|
#include "clang/AST/ASTContext.h"
|
||||||
|
@ -29,6 +30,7 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace clang {
|
namespace clang {
|
||||||
|
using namespace sema;
|
||||||
|
|
||||||
static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType,
|
static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType,
|
||||||
bool InOverloadResolution,
|
bool InOverloadResolution,
|
||||||
|
@ -327,7 +329,7 @@ namespace {
|
||||||
OverloadCandidate::DeductionFailureInfo
|
OverloadCandidate::DeductionFailureInfo
|
||||||
static MakeDeductionFailureInfo(ASTContext &Context,
|
static MakeDeductionFailureInfo(ASTContext &Context,
|
||||||
Sema::TemplateDeductionResult TDK,
|
Sema::TemplateDeductionResult TDK,
|
||||||
Sema::TemplateDeductionInfo &Info) {
|
TemplateDeductionInfo &Info) {
|
||||||
OverloadCandidate::DeductionFailureInfo Result;
|
OverloadCandidate::DeductionFailureInfo Result;
|
||||||
Result.Result = static_cast<unsigned>(TDK);
|
Result.Result = static_cast<unsigned>(TDK);
|
||||||
Result.Data = 0;
|
Result.Data = 0;
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "clang/Sema/Lookup.h"
|
#include "clang/Sema/Lookup.h"
|
||||||
#include "clang/Sema/Scope.h"
|
#include "clang/Sema/Scope.h"
|
||||||
#include "clang/Sema/Template.h"
|
#include "clang/Sema/Template.h"
|
||||||
|
#include "clang/Sema/TemplateDeduction.h"
|
||||||
#include "TreeTransform.h"
|
#include "TreeTransform.h"
|
||||||
#include "clang/AST/ASTContext.h"
|
#include "clang/AST/ASTContext.h"
|
||||||
#include "clang/AST/Expr.h"
|
#include "clang/AST/Expr.h"
|
||||||
|
@ -25,6 +26,7 @@
|
||||||
#include "clang/Basic/PartialDiagnostic.h"
|
#include "clang/Basic/PartialDiagnostic.h"
|
||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
using namespace clang;
|
using namespace clang;
|
||||||
|
using namespace sema;
|
||||||
|
|
||||||
/// \brief Determine whether the declaration found is acceptable as the name
|
/// \brief Determine whether the declaration found is acceptable as the name
|
||||||
/// of a template and, if so, return that template declaration. Otherwise,
|
/// of a template and, if so, return that template declaration. Otherwise,
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "clang/Sema/Sema.h"
|
#include "clang/Sema/Sema.h"
|
||||||
#include "clang/Sema/DeclSpec.h"
|
#include "clang/Sema/DeclSpec.h"
|
||||||
#include "clang/Sema/Template.h"
|
#include "clang/Sema/Template.h"
|
||||||
|
#include "clang/Sema/TemplateDeduction.h"
|
||||||
#include "clang/AST/ASTContext.h"
|
#include "clang/AST/ASTContext.h"
|
||||||
#include "clang/AST/DeclObjC.h"
|
#include "clang/AST/DeclObjC.h"
|
||||||
#include "clang/AST/DeclTemplate.h"
|
#include "clang/AST/DeclTemplate.h"
|
||||||
|
@ -22,6 +23,8 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace clang {
|
namespace clang {
|
||||||
|
using namespace sema;
|
||||||
|
|
||||||
/// \brief Various flags that control template argument deduction.
|
/// \brief Various flags that control template argument deduction.
|
||||||
///
|
///
|
||||||
/// These flags can be bitwise-OR'd together.
|
/// These flags can be bitwise-OR'd together.
|
||||||
|
@ -76,7 +79,7 @@ DeduceTemplateArguments(Sema &S,
|
||||||
TemplateParameterList *TemplateParams,
|
TemplateParameterList *TemplateParams,
|
||||||
const TemplateArgument &Param,
|
const TemplateArgument &Param,
|
||||||
const TemplateArgument &Arg,
|
const TemplateArgument &Arg,
|
||||||
Sema::TemplateDeductionInfo &Info,
|
TemplateDeductionInfo &Info,
|
||||||
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced);
|
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced);
|
||||||
|
|
||||||
/// \brief If the given expression is of a form that permits the deduction
|
/// \brief If the given expression is of a form that permits the deduction
|
||||||
|
@ -99,7 +102,7 @@ DeduceNonTypeTemplateArgument(Sema &S,
|
||||||
NonTypeTemplateParmDecl *NTTP,
|
NonTypeTemplateParmDecl *NTTP,
|
||||||
llvm::APSInt Value, QualType ValueType,
|
llvm::APSInt Value, QualType ValueType,
|
||||||
bool DeducedFromArrayBound,
|
bool DeducedFromArrayBound,
|
||||||
Sema::TemplateDeductionInfo &Info,
|
TemplateDeductionInfo &Info,
|
||||||
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
||||||
assert(NTTP->getDepth() == 0 &&
|
assert(NTTP->getDepth() == 0 &&
|
||||||
"Cannot deduce non-type template argument with depth > 0");
|
"Cannot deduce non-type template argument with depth > 0");
|
||||||
|
@ -140,7 +143,7 @@ static Sema::TemplateDeductionResult
|
||||||
DeduceNonTypeTemplateArgument(Sema &S,
|
DeduceNonTypeTemplateArgument(Sema &S,
|
||||||
NonTypeTemplateParmDecl *NTTP,
|
NonTypeTemplateParmDecl *NTTP,
|
||||||
Expr *Value,
|
Expr *Value,
|
||||||
Sema::TemplateDeductionInfo &Info,
|
TemplateDeductionInfo &Info,
|
||||||
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
||||||
assert(NTTP->getDepth() == 0 &&
|
assert(NTTP->getDepth() == 0 &&
|
||||||
"Cannot deduce non-type template argument with depth > 0");
|
"Cannot deduce non-type template argument with depth > 0");
|
||||||
|
@ -182,7 +185,7 @@ static Sema::TemplateDeductionResult
|
||||||
DeduceNonTypeTemplateArgument(Sema &S,
|
DeduceNonTypeTemplateArgument(Sema &S,
|
||||||
NonTypeTemplateParmDecl *NTTP,
|
NonTypeTemplateParmDecl *NTTP,
|
||||||
Decl *D,
|
Decl *D,
|
||||||
Sema::TemplateDeductionInfo &Info,
|
TemplateDeductionInfo &Info,
|
||||||
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
||||||
assert(NTTP->getDepth() == 0 &&
|
assert(NTTP->getDepth() == 0 &&
|
||||||
"Cannot deduce non-type template argument with depth > 0");
|
"Cannot deduce non-type template argument with depth > 0");
|
||||||
|
@ -216,7 +219,7 @@ DeduceTemplateArguments(Sema &S,
|
||||||
TemplateParameterList *TemplateParams,
|
TemplateParameterList *TemplateParams,
|
||||||
TemplateName Param,
|
TemplateName Param,
|
||||||
TemplateName Arg,
|
TemplateName Arg,
|
||||||
Sema::TemplateDeductionInfo &Info,
|
TemplateDeductionInfo &Info,
|
||||||
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
||||||
TemplateDecl *ParamDecl = Param.getAsTemplateDecl();
|
TemplateDecl *ParamDecl = Param.getAsTemplateDecl();
|
||||||
if (!ParamDecl) {
|
if (!ParamDecl) {
|
||||||
|
@ -280,7 +283,7 @@ DeduceTemplateArguments(Sema &S,
|
||||||
TemplateParameterList *TemplateParams,
|
TemplateParameterList *TemplateParams,
|
||||||
const TemplateSpecializationType *Param,
|
const TemplateSpecializationType *Param,
|
||||||
QualType Arg,
|
QualType Arg,
|
||||||
Sema::TemplateDeductionInfo &Info,
|
TemplateDeductionInfo &Info,
|
||||||
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
||||||
assert(Arg.isCanonical() && "Argument type must be canonical");
|
assert(Arg.isCanonical() && "Argument type must be canonical");
|
||||||
|
|
||||||
|
@ -372,7 +375,7 @@ static Sema::TemplateDeductionResult
|
||||||
DeduceTemplateArguments(Sema &S,
|
DeduceTemplateArguments(Sema &S,
|
||||||
TemplateParameterList *TemplateParams,
|
TemplateParameterList *TemplateParams,
|
||||||
QualType ParamIn, QualType ArgIn,
|
QualType ParamIn, QualType ArgIn,
|
||||||
Sema::TemplateDeductionInfo &Info,
|
TemplateDeductionInfo &Info,
|
||||||
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced,
|
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced,
|
||||||
unsigned TDF) {
|
unsigned TDF) {
|
||||||
// We only want to look at the canonical types, since typedefs and
|
// We only want to look at the canonical types, since typedefs and
|
||||||
|
@ -803,7 +806,7 @@ DeduceTemplateArguments(Sema &S,
|
||||||
TemplateParameterList *TemplateParams,
|
TemplateParameterList *TemplateParams,
|
||||||
const TemplateArgument &Param,
|
const TemplateArgument &Param,
|
||||||
const TemplateArgument &Arg,
|
const TemplateArgument &Arg,
|
||||||
Sema::TemplateDeductionInfo &Info,
|
TemplateDeductionInfo &Info,
|
||||||
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
||||||
switch (Param.getKind()) {
|
switch (Param.getKind()) {
|
||||||
case TemplateArgument::Null:
|
case TemplateArgument::Null:
|
||||||
|
@ -894,7 +897,7 @@ DeduceTemplateArguments(Sema &S,
|
||||||
TemplateParameterList *TemplateParams,
|
TemplateParameterList *TemplateParams,
|
||||||
const TemplateArgumentList &ParamList,
|
const TemplateArgumentList &ParamList,
|
||||||
const TemplateArgumentList &ArgList,
|
const TemplateArgumentList &ArgList,
|
||||||
Sema::TemplateDeductionInfo &Info,
|
TemplateDeductionInfo &Info,
|
||||||
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
||||||
assert(ParamList.size() == ArgList.size());
|
assert(ParamList.size() == ArgList.size());
|
||||||
for (unsigned I = 0, N = ParamList.size(); I != N; ++I) {
|
for (unsigned I = 0, N = ParamList.size(); I != N; ++I) {
|
||||||
|
@ -978,7 +981,7 @@ FinishTemplateArgumentDeduction(Sema &S,
|
||||||
ClassTemplatePartialSpecializationDecl *Partial,
|
ClassTemplatePartialSpecializationDecl *Partial,
|
||||||
const TemplateArgumentList &TemplateArgs,
|
const TemplateArgumentList &TemplateArgs,
|
||||||
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced,
|
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced,
|
||||||
Sema::TemplateDeductionInfo &Info) {
|
TemplateDeductionInfo &Info) {
|
||||||
// Trap errors.
|
// Trap errors.
|
||||||
Sema::SFINAETrap Trap(S);
|
Sema::SFINAETrap Trap(S);
|
||||||
|
|
||||||
|
@ -1014,7 +1017,7 @@ FinishTemplateArgumentDeduction(Sema &S,
|
||||||
// to the class template.
|
// to the class template.
|
||||||
// FIXME: Do we have to correct the types of deduced non-type template
|
// FIXME: Do we have to correct the types of deduced non-type template
|
||||||
// arguments (in particular, integral non-type template arguments?).
|
// arguments (in particular, integral non-type template arguments?).
|
||||||
Sema::LocalInstantiationScope InstScope(S);
|
LocalInstantiationScope InstScope(S);
|
||||||
ClassTemplateDecl *ClassTemplate = Partial->getSpecializedTemplate();
|
ClassTemplateDecl *ClassTemplate = Partial->getSpecializedTemplate();
|
||||||
const TemplateArgumentLoc *PartialTemplateArgs
|
const TemplateArgumentLoc *PartialTemplateArgs
|
||||||
= Partial->getTemplateArgsAsWritten();
|
= Partial->getTemplateArgsAsWritten();
|
||||||
|
@ -1562,7 +1565,7 @@ ResolveOverloadForDeduction(Sema &S, TemplateParameterList *TemplateParams,
|
||||||
// So we do not reject deductions which were made elsewhere.
|
// So we do not reject deductions which were made elsewhere.
|
||||||
llvm::SmallVector<DeducedTemplateArgument, 8>
|
llvm::SmallVector<DeducedTemplateArgument, 8>
|
||||||
Deduced(TemplateParams->size());
|
Deduced(TemplateParams->size());
|
||||||
Sema::TemplateDeductionInfo Info(S.Context, Ovl->getNameLoc());
|
TemplateDeductionInfo Info(S.Context, Ovl->getNameLoc());
|
||||||
unsigned TDF = 0;
|
unsigned TDF = 0;
|
||||||
|
|
||||||
Sema::TemplateDeductionResult Result
|
Sema::TemplateDeductionResult Result
|
||||||
|
@ -1629,7 +1632,7 @@ Sema::DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
|
||||||
|
|
||||||
// The types of the parameters from which we will perform template argument
|
// The types of the parameters from which we will perform template argument
|
||||||
// deduction.
|
// deduction.
|
||||||
Sema::LocalInstantiationScope InstScope(*this);
|
LocalInstantiationScope InstScope(*this);
|
||||||
TemplateParameterList *TemplateParams
|
TemplateParameterList *TemplateParams
|
||||||
= FunctionTemplate->getTemplateParameters();
|
= FunctionTemplate->getTemplateParameters();
|
||||||
llvm::SmallVector<DeducedTemplateArgument, 4> Deduced;
|
llvm::SmallVector<DeducedTemplateArgument, 4> Deduced;
|
||||||
|
@ -1789,7 +1792,7 @@ Sema::DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
|
||||||
QualType FunctionType = Function->getType();
|
QualType FunctionType = Function->getType();
|
||||||
|
|
||||||
// Substitute any explicit template arguments.
|
// Substitute any explicit template arguments.
|
||||||
Sema::LocalInstantiationScope InstScope(*this);
|
LocalInstantiationScope InstScope(*this);
|
||||||
llvm::SmallVector<DeducedTemplateArgument, 4> Deduced;
|
llvm::SmallVector<DeducedTemplateArgument, 4> Deduced;
|
||||||
unsigned NumExplicitlySpecified = 0;
|
unsigned NumExplicitlySpecified = 0;
|
||||||
llvm::SmallVector<QualType, 4> ParamTypes;
|
llvm::SmallVector<QualType, 4> ParamTypes;
|
||||||
|
@ -1921,7 +1924,7 @@ Sema::DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
|
||||||
// modulo the various allowed differences.
|
// modulo the various allowed differences.
|
||||||
|
|
||||||
// Finish template argument deduction.
|
// Finish template argument deduction.
|
||||||
Sema::LocalInstantiationScope InstScope(*this);
|
LocalInstantiationScope InstScope(*this);
|
||||||
FunctionDecl *Spec = 0;
|
FunctionDecl *Spec = 0;
|
||||||
TemplateDeductionResult Result
|
TemplateDeductionResult Result
|
||||||
= FinishTemplateArgumentDeduction(FunctionTemplate, Deduced, 0, Spec,
|
= FinishTemplateArgumentDeduction(FunctionTemplate, Deduced, 0, Spec,
|
||||||
|
@ -1985,7 +1988,7 @@ static Sema::TemplateDeductionResult
|
||||||
DeduceTemplateArgumentsDuringPartialOrdering(Sema &S,
|
DeduceTemplateArgumentsDuringPartialOrdering(Sema &S,
|
||||||
TemplateParameterList *TemplateParams,
|
TemplateParameterList *TemplateParams,
|
||||||
QualType ParamIn, QualType ArgIn,
|
QualType ParamIn, QualType ArgIn,
|
||||||
Sema::TemplateDeductionInfo &Info,
|
TemplateDeductionInfo &Info,
|
||||||
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced,
|
llvm::SmallVectorImpl<DeducedTemplateArgument> &Deduced,
|
||||||
llvm::SmallVectorImpl<DeductionQualifierComparison> *QualifierComparisons) {
|
llvm::SmallVectorImpl<DeductionQualifierComparison> *QualifierComparisons) {
|
||||||
CanQualType Param = S.Context.getCanonicalType(ParamIn);
|
CanQualType Param = S.Context.getCanonicalType(ParamIn);
|
||||||
|
@ -2067,7 +2070,7 @@ static bool isAtLeastAsSpecializedAs(Sema &S,
|
||||||
// C++0x [temp.deduct.partial]p3:
|
// C++0x [temp.deduct.partial]p3:
|
||||||
// The types used to determine the ordering depend on the context in which
|
// The types used to determine the ordering depend on the context in which
|
||||||
// the partial ordering is done:
|
// the partial ordering is done:
|
||||||
Sema::TemplateDeductionInfo Info(S.Context, Loc);
|
TemplateDeductionInfo Info(S.Context, Loc);
|
||||||
switch (TPOC) {
|
switch (TPOC) {
|
||||||
case TPOC_Call: {
|
case TPOC_Call: {
|
||||||
// - In the context of a function call, the function parameter types are
|
// - In the context of a function call, the function parameter types are
|
||||||
|
@ -2392,7 +2395,7 @@ Sema::getMoreSpecializedPartialSpecialization(
|
||||||
// template partial specialization's template arguments, for
|
// template partial specialization's template arguments, for
|
||||||
// example.
|
// example.
|
||||||
llvm::SmallVector<DeducedTemplateArgument, 4> Deduced;
|
llvm::SmallVector<DeducedTemplateArgument, 4> Deduced;
|
||||||
Sema::TemplateDeductionInfo Info(Context, Loc);
|
TemplateDeductionInfo Info(Context, Loc);
|
||||||
|
|
||||||
QualType PT1 = PS1->getInjectedSpecializationType();
|
QualType PT1 = PS1->getInjectedSpecializationType();
|
||||||
QualType PT2 = PS2->getInjectedSpecializationType();
|
QualType PT2 = PS2->getInjectedSpecializationType();
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "clang/Sema/DeclSpec.h"
|
#include "clang/Sema/DeclSpec.h"
|
||||||
#include "clang/Sema/Lookup.h"
|
#include "clang/Sema/Lookup.h"
|
||||||
#include "clang/Sema/Template.h"
|
#include "clang/Sema/Template.h"
|
||||||
|
#include "clang/Sema/TemplateDeduction.h"
|
||||||
#include "clang/AST/ASTConsumer.h"
|
#include "clang/AST/ASTConsumer.h"
|
||||||
#include "clang/AST/ASTContext.h"
|
#include "clang/AST/ASTContext.h"
|
||||||
#include "clang/AST/Expr.h"
|
#include "clang/AST/Expr.h"
|
||||||
|
@ -22,6 +23,7 @@
|
||||||
#include "clang/Basic/LangOptions.h"
|
#include "clang/Basic/LangOptions.h"
|
||||||
|
|
||||||
using namespace clang;
|
using namespace clang;
|
||||||
|
using namespace sema;
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===/
|
//===----------------------------------------------------------------------===/
|
||||||
// Template Instantiation Support
|
// Template Instantiation Support
|
||||||
|
@ -866,7 +868,7 @@ QualType TemplateInstantiator::TransformFunctionProtoType(TypeLocBuilder &TLB,
|
||||||
FunctionProtoTypeLoc TL,
|
FunctionProtoTypeLoc TL,
|
||||||
QualType ObjectType) {
|
QualType ObjectType) {
|
||||||
// We need a local instantiation scope for this function prototype.
|
// We need a local instantiation scope for this function prototype.
|
||||||
Sema::LocalInstantiationScope Scope(SemaRef, /*CombineWithOuterScope=*/true);
|
LocalInstantiationScope Scope(SemaRef, /*CombineWithOuterScope=*/true);
|
||||||
return inherited::TransformFunctionProtoType(TLB, TL, ObjectType);
|
return inherited::TransformFunctionProtoType(TLB, TL, ObjectType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1205,7 +1207,7 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation,
|
||||||
// instantiation scope with the enclosing scope. Otherwise, every
|
// instantiation scope with the enclosing scope. Otherwise, every
|
||||||
// instantiation of a class has its own local instantiation scope.
|
// instantiation of a class has its own local instantiation scope.
|
||||||
bool MergeWithParentScope = !Instantiation->isDefinedOutsideFunctionOrMethod();
|
bool MergeWithParentScope = !Instantiation->isDefinedOutsideFunctionOrMethod();
|
||||||
Sema::LocalInstantiationScope Scope(*this, MergeWithParentScope);
|
LocalInstantiationScope Scope(*this, MergeWithParentScope);
|
||||||
|
|
||||||
// Pull attributes from the pattern onto the instantiation.
|
// Pull attributes from the pattern onto the instantiation.
|
||||||
InstantiateAttrs(TemplateArgs, Pattern, Instantiation);
|
InstantiateAttrs(TemplateArgs, Pattern, Instantiation);
|
||||||
|
@ -1637,7 +1639,7 @@ bool Sema::Subst(const TemplateArgumentLoc &Input, TemplateArgumentLoc &Output,
|
||||||
return Instantiator.TransformTemplateArgument(Input, Output);
|
return Instantiator.TransformTemplateArgument(Input, Output);
|
||||||
}
|
}
|
||||||
|
|
||||||
Decl *Sema::LocalInstantiationScope::getInstantiationOf(const Decl *D) {
|
Decl *LocalInstantiationScope::getInstantiationOf(const Decl *D) {
|
||||||
for (LocalInstantiationScope *Current = this; Current;
|
for (LocalInstantiationScope *Current = this; Current;
|
||||||
Current = Current->Outer) {
|
Current = Current->Outer) {
|
||||||
// Check if we found something within this scope.
|
// Check if we found something within this scope.
|
||||||
|
@ -1656,8 +1658,7 @@ Decl *Sema::LocalInstantiationScope::getInstantiationOf(const Decl *D) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sema::LocalInstantiationScope::InstantiatedLocal(const Decl *D,
|
void LocalInstantiationScope::InstantiatedLocal(const Decl *D, Decl *Inst) {
|
||||||
Decl *Inst) {
|
|
||||||
Decl *&Stored = LocalDecls[D];
|
Decl *&Stored = LocalDecls[D];
|
||||||
assert((!Stored || Stored == Inst)&& "Already instantiated this local");
|
assert((!Stored || Stored == Inst)&& "Already instantiated this local");
|
||||||
Stored = Inst;
|
Stored = Inst;
|
||||||
|
|
|
@ -677,7 +677,7 @@ Decl *TemplateDeclInstantiator::VisitClassTemplateDecl(ClassTemplateDecl *D) {
|
||||||
|
|
||||||
// Create a local instantiation scope for this class template, which
|
// Create a local instantiation scope for this class template, which
|
||||||
// will contain the instantiations of the template parameters.
|
// will contain the instantiations of the template parameters.
|
||||||
Sema::LocalInstantiationScope Scope(SemaRef);
|
LocalInstantiationScope Scope(SemaRef);
|
||||||
TemplateParameterList *TempParams = D->getTemplateParameters();
|
TemplateParameterList *TempParams = D->getTemplateParameters();
|
||||||
TemplateParameterList *InstParams = SubstTemplateParams(TempParams);
|
TemplateParameterList *InstParams = SubstTemplateParams(TempParams);
|
||||||
if (!InstParams)
|
if (!InstParams)
|
||||||
|
@ -864,7 +864,7 @@ TemplateDeclInstantiator::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) {
|
||||||
// will contain the instantiations of the template parameters and then get
|
// will contain the instantiations of the template parameters and then get
|
||||||
// merged with the local instantiation scope for the function template
|
// merged with the local instantiation scope for the function template
|
||||||
// itself.
|
// itself.
|
||||||
Sema::LocalInstantiationScope Scope(SemaRef);
|
LocalInstantiationScope Scope(SemaRef);
|
||||||
|
|
||||||
TemplateParameterList *TempParams = D->getTemplateParameters();
|
TemplateParameterList *TempParams = D->getTemplateParameters();
|
||||||
TemplateParameterList *InstParams = SubstTemplateParams(TempParams);
|
TemplateParameterList *InstParams = SubstTemplateParams(TempParams);
|
||||||
|
@ -988,7 +988,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D,
|
||||||
Owner->isFunctionOrMethod() ||
|
Owner->isFunctionOrMethod() ||
|
||||||
!(isa<Decl>(Owner) &&
|
!(isa<Decl>(Owner) &&
|
||||||
cast<Decl>(Owner)->isDefinedOutsideFunctionOrMethod());
|
cast<Decl>(Owner)->isDefinedOutsideFunctionOrMethod());
|
||||||
Sema::LocalInstantiationScope Scope(SemaRef, MergeWithParentScope);
|
LocalInstantiationScope Scope(SemaRef, MergeWithParentScope);
|
||||||
|
|
||||||
llvm::SmallVector<ParmVarDecl *, 4> Params;
|
llvm::SmallVector<ParmVarDecl *, 4> Params;
|
||||||
TypeSourceInfo *TInfo = D->getTypeSourceInfo();
|
TypeSourceInfo *TInfo = D->getTypeSourceInfo();
|
||||||
|
@ -1237,7 +1237,7 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D,
|
||||||
bool MergeWithParentScope = (TemplateParams != 0) ||
|
bool MergeWithParentScope = (TemplateParams != 0) ||
|
||||||
!(isa<Decl>(Owner) &&
|
!(isa<Decl>(Owner) &&
|
||||||
cast<Decl>(Owner)->isDefinedOutsideFunctionOrMethod());
|
cast<Decl>(Owner)->isDefinedOutsideFunctionOrMethod());
|
||||||
Sema::LocalInstantiationScope Scope(SemaRef, MergeWithParentScope);
|
LocalInstantiationScope Scope(SemaRef, MergeWithParentScope);
|
||||||
|
|
||||||
llvm::SmallVector<ParmVarDecl *, 4> Params;
|
llvm::SmallVector<ParmVarDecl *, 4> Params;
|
||||||
TypeSourceInfo *TInfo = D->getTypeSourceInfo();
|
TypeSourceInfo *TInfo = D->getTypeSourceInfo();
|
||||||
|
@ -1508,7 +1508,7 @@ TemplateDeclInstantiator::VisitTemplateTemplateParmDecl(
|
||||||
{
|
{
|
||||||
// Perform the actual substitution of template parameters within a new,
|
// Perform the actual substitution of template parameters within a new,
|
||||||
// local instantiation scope.
|
// local instantiation scope.
|
||||||
Sema::LocalInstantiationScope Scope(SemaRef);
|
LocalInstantiationScope Scope(SemaRef);
|
||||||
InstParams = SubstTemplateParams(TempParams);
|
InstParams = SubstTemplateParams(TempParams);
|
||||||
if (!InstParams)
|
if (!InstParams)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1735,7 +1735,7 @@ TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization(
|
||||||
// Create a local instantiation scope for this class template partial
|
// Create a local instantiation scope for this class template partial
|
||||||
// specialization, which will contain the instantiations of the template
|
// specialization, which will contain the instantiations of the template
|
||||||
// parameters.
|
// parameters.
|
||||||
Sema::LocalInstantiationScope Scope(SemaRef);
|
LocalInstantiationScope Scope(SemaRef);
|
||||||
|
|
||||||
// Substitute into the template parameters of the class template partial
|
// Substitute into the template parameters of the class template partial
|
||||||
// specialization.
|
// specialization.
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "clang/Sema/Scope.h"
|
#include "clang/Sema/Scope.h"
|
||||||
#include "clang/AST/ASTConsumer.h"
|
#include "clang/AST/ASTConsumer.h"
|
||||||
#include "clang/AST/ASTContext.h"
|
#include "clang/AST/ASTContext.h"
|
||||||
|
#include "clang/AST/DeclTemplate.h"
|
||||||
#include "clang/AST/Expr.h"
|
#include "clang/AST/Expr.h"
|
||||||
#include "clang/AST/ExprCXX.h"
|
#include "clang/AST/ExprCXX.h"
|
||||||
#include "clang/AST/Type.h"
|
#include "clang/AST/Type.h"
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "clang/AST/ASTContext.h"
|
#include "clang/AST/ASTContext.h"
|
||||||
#include "clang/AST/Decl.h"
|
#include "clang/AST/Decl.h"
|
||||||
#include "clang/AST/DeclContextInternals.h"
|
#include "clang/AST/DeclContextInternals.h"
|
||||||
|
#include "clang/AST/DeclTemplate.h"
|
||||||
#include "clang/AST/Expr.h"
|
#include "clang/AST/Expr.h"
|
||||||
#include "clang/AST/ExprCXX.h"
|
#include "clang/AST/ExprCXX.h"
|
||||||
#include "clang/AST/Type.h"
|
#include "clang/AST/Type.h"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче