зеркало из https://github.com/microsoft/clang-1.git
In Initialization, add step kind SK_ListConstructorCall (list-initialization
resolves to a constructor call in C++11) and failure kind FK_ListInitializationFailed (early InitListChecker run failed). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140456 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
b0edea9f03
Коммит
8713d4e874
|
@ -526,8 +526,10 @@ public:
|
|||
SK_QualificationConversionLValue,
|
||||
/// \brief Perform an implicit conversion sequence.
|
||||
SK_ConversionSequence,
|
||||
/// \brief Perform list-initialization
|
||||
/// \brief Perform list-initialization without a constructor
|
||||
SK_ListInitialization,
|
||||
/// \brief Perform list-initialization with a constructor.
|
||||
SK_ListConstructorCall,
|
||||
/// \brief Perform initialization via a constructor.
|
||||
SK_ConstructorInitialization,
|
||||
/// \brief Zero-initialize the object
|
||||
|
@ -563,6 +565,8 @@ public:
|
|||
/// \brief When Kind == SK_ResolvedOverloadedFunction or Kind ==
|
||||
/// SK_UserConversion, the function that the expression should be
|
||||
/// resolved to or the conversion function to call, respectively.
|
||||
/// When Kind == SK_ConstructorInitialization or SK_ListConstruction,
|
||||
/// the constructor to be called.
|
||||
///
|
||||
/// Always a FunctionDecl.
|
||||
/// For conversion decls, the naming class is the source type.
|
||||
|
@ -634,7 +638,9 @@ public:
|
|||
/// \brief Default-initialization of a 'const' object.
|
||||
FK_DefaultInitOfConst,
|
||||
/// \brief Initialization of an incomplete type.
|
||||
FK_Incomplete
|
||||
FK_Incomplete,
|
||||
/// \brief List initialization failed at some point.
|
||||
FK_ListInitializationFailed
|
||||
};
|
||||
|
||||
private:
|
||||
|
|
|
@ -2216,6 +2216,7 @@ void InitializationSequence::Step::Destroy() {
|
|||
case SK_QualificationConversionXValue:
|
||||
case SK_QualificationConversionLValue:
|
||||
case SK_ListInitialization:
|
||||
case SK_ListConstructorCall:
|
||||
case SK_ConstructorInitialization:
|
||||
case SK_ZeroInitialization:
|
||||
case SK_CAssignment:
|
||||
|
@ -2259,6 +2260,7 @@ bool InitializationSequence::isAmbiguous() const {
|
|||
case FK_Incomplete:
|
||||
case FK_ArrayTypeMismatch:
|
||||
case FK_NonConstantArrayInit:
|
||||
case FK_ListInitializationFailed:
|
||||
return false;
|
||||
|
||||
case FK_ReferenceInitOverloadFailed:
|
||||
|
@ -4232,6 +4234,7 @@ InitializationSequence::Perform(Sema &S,
|
|||
case SK_QualificationConversionXValue:
|
||||
case SK_QualificationConversionRValue:
|
||||
case SK_ConversionSequence:
|
||||
case SK_ListConstructorCall:
|
||||
case SK_ListInitialization:
|
||||
case SK_CAssignment:
|
||||
case SK_StringInit:
|
||||
|
@ -4511,6 +4514,9 @@ InitializationSequence::Perform(Sema &S,
|
|||
break;
|
||||
}
|
||||
|
||||
case SK_ListConstructorCall:
|
||||
assert(false && "List constructor calls not yet supported.");
|
||||
|
||||
case SK_ConstructorInitialization: {
|
||||
unsigned NumArgs = Args.size();
|
||||
CXXConstructorDecl *Constructor
|
||||
|
@ -5011,10 +5017,13 @@ bool InitializationSequence::Diagnose(Sema &S,
|
|||
}
|
||||
break;
|
||||
|
||||
case FK_Incomplete:
|
||||
S.RequireCompleteType(Kind.getLocation(), DestType,
|
||||
diag::err_init_incomplete_type);
|
||||
break;
|
||||
case FK_Incomplete:
|
||||
S.RequireCompleteType(Kind.getLocation(), DestType,
|
||||
diag::err_init_incomplete_type);
|
||||
break;
|
||||
|
||||
case FK_ListInitializationFailed:
|
||||
assert(false && "Failed list initialization not yet handled.");
|
||||
}
|
||||
|
||||
PrintInitLocationNote(S, Entity);
|
||||
|
@ -5109,6 +5118,9 @@ void InitializationSequence::dump(raw_ostream &OS) const {
|
|||
case FK_Incomplete:
|
||||
OS << "initialization of incomplete type";
|
||||
break;
|
||||
|
||||
case FK_ListInitializationFailed:
|
||||
OS << "list initialization failed";
|
||||
}
|
||||
OS << '\n';
|
||||
return;
|
||||
|
@ -5178,7 +5190,11 @@ void InitializationSequence::dump(raw_ostream &OS) const {
|
|||
break;
|
||||
|
||||
case SK_ListInitialization:
|
||||
OS << "list initialization";
|
||||
OS << "list aggregate initialization";
|
||||
break;
|
||||
|
||||
case SK_ListConstructorCall:
|
||||
OS << "list initialization via constructor";
|
||||
break;
|
||||
|
||||
case SK_ConstructorInitialization:
|
||||
|
|
Загрузка…
Ссылка в новой задаче