<div dir="auto">In the future, please land whitespace changes in a separate commit.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sep 20, 2017 6:29 PM, "Erich Keane via cfe-commits" <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: erichkeane<br>
Date: Wed Sep 20 15:28:24 2017<br>
New Revision: 313828<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=313828&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=313828&view=rev</a><br>
Log:<br>
[MS Compat]Allow __interfaces to have properties.<br>
<br>
__interface types are allowed in MSVC to have "property" data members<br>
(marked with declspec property). This patch alters Sema to allow property<br>
data members.<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D38092" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D38092</a><br>
<br>
<br>
Modified:<br>
cfe/trunk/lib/Sema/<wbr>SemaDeclCXX.cpp<br>
cfe/trunk/test/SemaCXX/ms-<wbr>interface.cpp<br>
<br>
Modified: cfe/trunk/lib/Sema/<wbr>SemaDeclCXX.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=313828&r1=313827&r2=313828&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Sema/<wbr>SemaDeclCXX.cpp?rev=313828&r1=<wbr>313827&r2=313828&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Sema/<wbr>SemaDeclCXX.cpp (original)<br>
+++ cfe/trunk/lib/Sema/<wbr>SemaDeclCXX.cpp Wed Sep 20 15:28:24 2017<br>
@@ -143,7 +143,7 @@ namespace {<br>
if (Lambda->capture_begin() == Lambda->capture_end())<br>
return false;<br>
<br>
- return S->Diag(Lambda->getLocStart(),<br>
+ return S->Diag(Lambda->getLocStart(),<br>
diag::err_lambda_capture_<wbr>default_arg);<br>
}<br>
}<br>
@@ -276,18 +276,18 @@ Sema::SetParamDefaultArgument(<wbr>ParmVarDec<br>
// Okay: add the default argument to the parameter<br>
Param->setDefaultArg(Arg);<br>
<br>
- // We have already instantiated this parameter; provide each of the<br>
+ // We have already instantiated this parameter; provide each of the<br>
// instantiations with the uninstantiated default argument.<br>
UnparsedDefaultArgInstantiatio<wbr>nsMap::iterator InstPos<br>
= UnparsedDefaultArgInstantiatio<wbr>ns.find(Param);<br>
if (InstPos != UnparsedDefaultArgInstantiatio<wbr>ns.end()) {<br>
for (unsigned I = 0, N = InstPos->second.size(); I != N; ++I)<br>
InstPos->second[I]-><wbr>setUninstantiatedDefaultArg(<wbr>Arg);<br>
-<br>
+<br>
// We're done tracking this parameter's instantiations.<br>
UnparsedDefaultArgInstantiatio<wbr>ns.erase(InstPos);<br>
}<br>
-<br>
+<br>
return false;<br>
}<br>
<br>
@@ -524,8 +524,8 @@ bool Sema::MergeCXXFunctionDecl(<wbr>Function<br>
Invalid = false;<br>
}<br>
}<br>
-<br>
- // FIXME: If we knew where the '=' was, we could easily provide a fix-it<br>
+<br>
+ // FIXME: If we knew where the '=' was, we could easily provide a fix-it<br>
// hint here. Alternatively, we could walk the type-source information<br>
// for NewParam to find the last source location in the type... but it<br>
// isn't worth the effort right now. This is the kind of test case that<br>
@@ -535,7 +535,7 @@ bool Sema::MergeCXXFunctionDecl(<wbr>Function<br>
// void g(int (*fp)(int) = &f);<br>
Diag(NewParam->getLocation(), DiagDefaultParamID)<br>
<< NewParam->getDefaultArgRange()<wbr>;<br>
-<br>
+<br>
// Look for the function declaration where the default argument was<br>
// actually written, which may be a declaration prior to Old.<br>
for (auto Older = PrevForDefaultArgs;<br>
@@ -581,9 +581,9 @@ bool Sema::MergeCXXFunctionDecl(<wbr>Function<br>
// or a definition for one of the following explicit specializations:<br>
// - the explicit specialization of a function template;<br>
// - the explicit specialization of a member function template;<br>
- // - the explicit specialization of a member function of a class<br>
+ // - the explicit specialization of a member function of a class<br>
// template where the class template specialization to which the<br>
- // member function specialization belongs is implicitly<br>
+ // member function specialization belongs is implicitly<br>
// instantiated.<br>
Diag(NewParam->getLocation(), diag::err_template_spec_<wbr>default_arg)<br>
<< (New-><wbr>getTemplateSpecializationKind(<wbr>) ==TSK_ExplicitSpecialization)<br>
@@ -591,16 +591,16 @@ bool Sema::MergeCXXFunctionDecl(<wbr>Function<br>
<< NewParam->getDefaultArgRange()<wbr>;<br>
} else if (New->getDeclContext()-><wbr>isDependentContext()) {<br>
// C++ [dcl.fct.default]p6 (DR217):<br>
- // Default arguments for a member function of a class template shall<br>
- // be specified on the initial declaration of the member function<br>
+ // Default arguments for a member function of a class template shall<br>
+ // be specified on the initial declaration of the member function<br>
// within the class template.<br>
//<br>
- // Reading the tea leaves a bit in DR217 and its reference to DR205<br>
- // leads me to the conclusion that one cannot add default function<br>
- // arguments for an out-of-line definition of a member function of a<br>
+ // Reading the tea leaves a bit in DR217 and its reference to DR205<br>
+ // leads me to the conclusion that one cannot add default function<br>
+ // arguments for an out-of-line definition of a member function of a<br>
// dependent type.<br>
int WhichKind = 2;<br>
- if (CXXRecordDecl *Record<br>
+ if (CXXRecordDecl *Record<br>
= dyn_cast<CXXRecordDecl>(New-><wbr>getDeclContext())) {<br>
if (Record-><wbr>getDescribedClassTemplate())<br>
WhichKind = 0;<br>
@@ -609,8 +609,8 @@ bool Sema::MergeCXXFunctionDecl(<wbr>Function<br>
else<br>
WhichKind = 2;<br>
}<br>
-<br>
- Diag(NewParam->getLocation(),<br>
+<br>
+ Diag(NewParam->getLocation(),<br>
diag::err_param_default_<wbr>argument_member_template_<wbr>redecl)<br>
<< WhichKind<br>
<< NewParam->getDefaultArgRange()<wbr>;<br>
@@ -2148,7 +2148,7 @@ Sema::CheckBaseSpecifier(<wbr>CXXRecordDecl *<br>
return nullptr;<br>
}<br>
<br>
- if (EllipsisLoc.isValid() &&<br>
+ if (EllipsisLoc.isValid() &&<br>
!TInfo->getType()-><wbr>containsUnexpandedParameterPac<wbr>k()) {<br>
Diag(EllipsisLoc, diag::err_pack_expansion_<wbr>without_parameter_packs)<br>
<< TInfo->getTypeLoc().<wbr>getSourceRange();<br>
@@ -2297,10 +2297,10 @@ Sema::ActOnBaseSpecifier(Decl *classdecl<br>
GetTypeFromParser(basetype, &TInfo);<br>
<br>
if (EllipsisLoc.isInvalid() &&<br>
- DiagnoseUnexpandedParameterPac<wbr>k(SpecifierRange.getBegin(), TInfo,<br>
+ DiagnoseUnexpandedParameterPac<wbr>k(SpecifierRange.getBegin(), TInfo,<br>
UPPC_BaseType))<br>
return true;<br>
-<br>
+<br>
if (CXXBaseSpecifier *BaseSpec = CheckBaseSpecifier(Class, SpecifierRange,<br>
Virtual, Access, TInfo,<br>
EllipsisLoc))<br>
@@ -2384,7 +2384,7 @@ bool Sema::AttachBaseSpecifiers(<wbr>CXXRecor<br>
// Note this base's direct & indirect bases, if there could be ambiguity.<br>
if (Bases.size() > 1)<br>
NoteIndirectBases(Context, IndirectBaseTypes, NewBaseType);<br>
-<br>
+<br>
if (const RecordType *Record = NewBaseType->getAs<RecordType><wbr>()) {<br>
const CXXRecordDecl *RD = cast<CXXRecordDecl>(Record-><wbr>getDecl());<br>
if (Class->isInterface() &&<br>
@@ -2405,7 +2405,7 @@ bool Sema::AttachBaseSpecifiers(<wbr>CXXRecor<br>
<br>
// Attach the remaining base class specifiers to the derived class.<br>
Class->setBases(Bases.data(), NumGoodBases);<br>
-<br>
+<br>
for (unsigned idx = 0; idx < NumGoodBases; ++idx) {<br>
// Check whether this direct base is inaccessible due to ambiguity.<br>
QualType BaseType = Bases[idx]->getType();<br>
@@ -2457,7 +2457,7 @@ bool Sema::IsDerivedFrom(<wbr>SourceLocation<br>
CXXRecordDecl *DerivedRD = Derived->getAsCXXRecordDecl();<br>
if (!DerivedRD)<br>
return false;<br>
-<br>
+<br>
CXXRecordDecl *BaseRD = Base->getAsCXXRecordDecl();<br>
if (!BaseRD)<br>
return false;<br>
@@ -2471,7 +2471,7 @@ bool Sema::IsDerivedFrom(<wbr>SourceLocation<br>
// to be able to use the inheritance relationship?<br>
if (!isCompleteType(Loc, Derived) && !DerivedRD->isBeingDefined())<br>
return false;<br>
-<br>
+<br>
return DerivedRD->isDerivedFrom(<wbr>BaseRD);<br>
}<br>
<br>
@@ -2481,28 +2481,28 @@ bool Sema::IsDerivedFrom(<wbr>SourceLocation<br>
CXXBasePaths &Paths) {<br>
if (!getLangOpts().CPlusPlus)<br>
return false;<br>
-<br>
+<br>
CXXRecordDecl *DerivedRD = Derived->getAsCXXRecordDecl();<br>
if (!DerivedRD)<br>
return false;<br>
-<br>
+<br>
CXXRecordDecl *BaseRD = Base->getAsCXXRecordDecl();<br>
if (!BaseRD)<br>
return false;<br>
-<br>
+<br>
if (!isCompleteType(Loc, Derived) && !DerivedRD->isBeingDefined())<br>
return false;<br>
-<br>
+<br>
return DerivedRD->isDerivedFrom(<wbr>BaseRD, Paths);<br>
}<br>
<br>
-void Sema::BuildBasePathArray(const CXXBasePaths &Paths,<br>
+void Sema::BuildBasePathArray(const CXXBasePaths &Paths,<br>
CXXCastPath &BasePathArray) {<br>
assert(BasePathArray.empty() && "Base path array must be empty!");<br>
assert(Paths.isRecordingPaths(<wbr>) && "Must record paths!");<br>
-<br>
+<br>
const CXXBasePath &Path = Paths.front();<br>
-<br>
+<br>
// We first go backward and check if we have a virtual base.<br>
// FIXME: It would be better if CXXBasePath had the base specifier for<br>
// the nearest virtual base.<br>
@@ -2549,27 +2549,27 @@ Sema::<wbr>CheckDerivedToBaseConversion(<wbr>QualT<br>
assert(DerivationOkay &&<br>
"Can only be used with a derived-to-base conversion");<br>
(void)DerivationOkay;<br>
-<br>
+<br>
if (!Paths.isAmbiguous(Context.<wbr>getCanonicalType(Base).<wbr>getUnqualifiedType())) {<br>
if (!IgnoreAccess) {<br>
// Check that the base class can be accessed.<br>
switch (CheckBaseClassAccess(Loc, Base, Derived, Paths.front(),<br>
InaccessibleBaseID)) {<br>
- case AR_inaccessible:<br>
+ case AR_inaccessible:<br>
return true;<br>
- case AR_accessible:<br>
+ case AR_accessible:<br>
case AR_dependent:<br>
case AR_delayed:<br>
break;<br>
}<br>
}<br>
-<br>
+<br>
// Build a base path if necessary.<br>
if (BasePath)<br>
BuildBasePathArray(Paths, *BasePath);<br>
return false;<br>
}<br>
-<br>
+<br>
if (AmbigiousBaseConvID) {<br>
// We know that the derived-to-base conversion is ambiguous, and<br>
// we're going to produce a diagnostic. Perform the derived-to-base<br>
@@ -2634,7 +2634,7 @@ std::string Sema::getAmbiguousPathsDispl<br>
PathDisplayStr += " -> " + Element->Base->getType().<wbr>getAsString();<br>
}<br>
}<br>
-<br>
+<br>
return PathDisplayStr;<br>
}<br>
<br>
@@ -2857,6 +2857,8 @@ Sema::<wbr>ActOnCXXMemberDeclarator(Scope *S,<br>
assert(!DS.isFriendSpecified()<wbr>);<br>
<br>
bool isFunc = D.isDeclarationOfFunction();<br>
+ AttributeList *MSPropertyAttr =<br>
+ getMSPropertyAttr(D.<wbr>getDeclSpec().getAttributes().<wbr>getList());<br>
<br>
if (cast<CXXRecordDecl>(<wbr>CurContext)->isInterface()) {<br>
// The Microsoft extension __interface only permits public member functions<br>
@@ -2864,8 +2866,11 @@ Sema::<wbr>ActOnCXXMemberDeclarator(Scope *S,<br>
// functions, static methods and data members.<br>
unsigned InvalidDecl;<br>
bool ShowDeclName = true;<br>
- if (!isFunc)<br>
- InvalidDecl = (DS.getStorageClassSpec() == DeclSpec::SCS_typedef) ? 0 : 1;<br>
+ if (!isFunc &&<br>
+ (DS.getStorageClassSpec() == DeclSpec::SCS_typedef || MSPropertyAttr))<br>
+ InvalidDecl = 0;<br>
+ else if (!isFunc)<br>
+ InvalidDecl = 1;<br>
else if (AS != AS_public)<br>
InvalidDecl = 2;<br>
else if (DS.getStorageClassSpec() == DeclSpec::SCS_static)<br>
@@ -3013,12 +3018,10 @@ Sema::<wbr>ActOnCXXMemberDeclarator(Scope *S,<br>
else<br>
Diag(D.getIdentifierLoc(), diag::err_member_<wbr>qualification)<br>
<< Name << SS.getRange();<br>
-<br>
+<br>
SS.clear();<br>
}<br>
<br>
- AttributeList *MSPropertyAttr =<br>
- getMSPropertyAttr(D.<wbr>getDeclSpec().getAttributes().<wbr>getList());<br>
if (MSPropertyAttr) {<br>
Member = HandleMSProperty(S, cast<CXXRecordDecl>(<wbr>CurContext), Loc, D,<br>
BitWidth, InitStyle, AS, MSPropertyAttr);<br>
@@ -3582,7 +3585,7 @@ void Sema::<wbr>ActOnFinishCXXInClassMemberIn<br>
/// \brief Find the direct and/or virtual base specifiers that<br>
/// correspond to the given base type, for use in base initialization<br>
/// within a constructor.<br>
-static bool FindBaseInitializer(Sema &SemaRef,<br>
+static bool FindBaseInitializer(Sema &SemaRef,<br>
CXXRecordDecl *ClassDecl,<br>
QualType BaseType,<br>
const CXXBaseSpecifier *&DirectBaseSpec,<br>
@@ -3766,7 +3769,7 @@ Sema::BuildMemInitializer(Decl *Construc<br>
if (SS.isSet() && isDependentScopeSpecifier(SS)) {<br>
bool NotUnknownSpecialization = false;<br>
DeclContext *DC = computeDeclContext(SS, false);<br>
- if (CXXRecordDecl *Record = dyn_cast_or_null<<wbr>CXXRecordDecl>(DC))<br>
+ if (CXXRecordDecl *Record = dyn_cast_or_null<<wbr>CXXRecordDecl>(DC))<br>
NotUnknownSpecialization = !Record->hasAnyDependentBases(<wbr>);<br>
<br>
if (!NotUnknownSpecialization) {<br>
@@ -3810,7 +3813,7 @@ Sema::BuildMemInitializer(Decl *Construc<br>
} else if (TypeDecl *Type = Corr.getCorrectionDeclAs<<wbr>TypeDecl>()) {<br>
const CXXBaseSpecifier *DirectBaseSpec;<br>
const CXXBaseSpecifier *VirtualBaseSpec;<br>
- if (FindBaseInitializer(*this, ClassDecl,<br>
+ if (FindBaseInitializer(*this, ClassDecl,<br>
Context.getTypeDeclType(Type),<br>
DirectBaseSpec, VirtualBaseSpec)) {<br>
// We have found a direct or virtual base class with a<br>
@@ -4035,7 +4038,7 @@ Sema::<wbr>BuildDelegatingInitializer(<wbr>TypeSou<br>
if (CurContext-><wbr>isDependentContext())<br>
DelegationInit = Init;<br>
<br>
- return new (Context) CXXCtorInitializer(Context, TInfo, InitRange.getBegin(),<br>
+ return new (Context) CXXCtorInitializer(Context, TInfo, InitRange.getBegin(),<br>
DelegationInit.getAs<Expr>(),<br>
InitRange.getEnd());<br>
}<br>
@@ -4080,12 +4083,12 @@ Sema::BuildBaseInitializer(<wbr>QualType Base<br>
// Check for direct and virtual base classes.<br>
const CXXBaseSpecifier *DirectBaseSpec = nullptr;<br>
const CXXBaseSpecifier *VirtualBaseSpec = nullptr;<br>
- if (!Dependent) {<br>
+ if (!Dependent) {<br>
if (Context.<wbr>hasSameUnqualifiedType(<wbr>QualType(ClassDecl-><wbr>getTypeForDecl(),0),<br>
BaseType))<br>
return BuildDelegatingInitializer(<wbr>BaseTInfo, Init, ClassDecl);<br>
<br>
- FindBaseInitializer(*this, ClassDecl, BaseType, DirectBaseSpec,<br>
+ FindBaseInitializer(*this, ClassDecl, BaseType, DirectBaseSpec,<br>
VirtualBaseSpec);<br>
<br>
// C++ [base.class.init]p2:<br>
@@ -4205,7 +4208,7 @@ BuildImplicitBaseInitializer(<wbr>Sema &SemaR<br>
IsInheritedVirtualBase);<br>
<br>
ExprResult BaseInit;<br>
-<br>
+<br>
switch (ImplicitInitKind) {<br>
case IIK_Inherit:<br>
case IIK_Default: {<br>
@@ -4222,7 +4225,7 @@ BuildImplicitBaseInitializer(<wbr>Sema &SemaR<br>
ParmVarDecl *Param = Constructor->getParamDecl(0);<br>
QualType ParamType = Param->getType().<wbr>getNonReferenceType();<br>
<br>
- Expr *CopyCtorArg =<br>
+ Expr *CopyCtorArg =<br>
DeclRefExpr::Create(SemaRef.<wbr>Context, NestedNameSpecifierLoc(),<br>
SourceLocation(), Param, false,<br>
Constructor->getLocation(), ParamType,<br>
@@ -4231,8 +4234,8 @@ BuildImplicitBaseInitializer(<wbr>Sema &SemaR<br>
SemaRef.MarkDeclRefReferenced(<wbr>cast<DeclRefExpr>(CopyCtorArg)<wbr>);<br>
<br>
// Cast to the base class to avoid ambiguities.<br>
- QualType ArgTy =<br>
- SemaRef.Context.<wbr>getQualifiedType(BaseSpec-><wbr>getType().getUnqualifiedType()<wbr>,<br>
+ QualType ArgTy =<br>
+ SemaRef.Context.<wbr>getQualifiedType(BaseSpec-><wbr>getType().getUnqualifiedType()<wbr>,<br>
ParamType.getQualifiers());<br>
<br>
if (Moving) {<br>
@@ -4258,10 +4261,10 @@ BuildImplicitBaseInitializer(<wbr>Sema &SemaR<br>
BaseInit = SemaRef.<wbr>MaybeCreateExprWithCleanups(<wbr>BaseInit);<br>
if (BaseInit.isInvalid())<br>
return true;<br>
-<br>
+<br>
CXXBaseInit =<br>
new (SemaRef.Context) CXXCtorInitializer(SemaRef.<wbr>Context,<br>
- SemaRef.Context.<wbr>getTrivialTypeSourceInfo(<wbr>BaseSpec->getType(),<br>
+ SemaRef.Context.<wbr>getTrivialTypeSourceInfo(<wbr>BaseSpec->getType(),<br>
SourceLocation()),<br>
BaseSpec->isVirtual(),<br>
SourceLocation(),<br>
@@ -4295,8 +4298,8 @@ BuildImplicitMemberInitializer<wbr>(Sema &Sem<br>
// Suppress copying zero-width bitfields.<br>
if (Field->isBitField() && Field->getBitWidthValue(<wbr>SemaRef.Context) == 0)<br>
return false;<br>
-<br>
- Expr *MemberExprBase =<br>
+<br>
+ Expr *MemberExprBase =<br>
DeclRefExpr::Create(SemaRef.<wbr>Context, NestedNameSpecifierLoc(),<br>
SourceLocation(), Param, false,<br>
Loc, ParamType, VK_LValue, nullptr);<br>
@@ -4314,7 +4317,7 @@ BuildImplicitMemberInitializer<wbr>(Sema &Sem<br>
MemberLookup.addDecl(Indirect ? cast<ValueDecl>(Indirect)<br>
: cast<ValueDecl>(Field), AS_public);<br>
MemberLookup.resolveKind();<br>
- ExprResult CtorArg<br>
+ ExprResult CtorArg<br>
= SemaRef.<wbr>BuildMemberReferenceExpr(<wbr>MemberExprBase,<br>
ParamType, Loc,<br>
/*IsArrow=*/false,<br>
@@ -4343,7 +4346,7 @@ BuildImplicitMemberInitializer<wbr>(Sema &Sem<br>
// Direct-initialize to use the copy constructor.<br>
InitializationKind InitKind =<br>
InitializationKind::<wbr>CreateDirect(Loc, SourceLocation(), SourceLocation());<br>
-<br>
+<br>
Expr *CtorArgE = CtorArg.getAs<Expr>();<br>
InitializationSequence InitSeq(SemaRef, Entity, InitKind, CtorArgE);<br>
ExprResult MemberInit =<br>
@@ -4364,16 +4367,16 @@ BuildImplicitMemberInitializer<wbr>(Sema &Sem<br>
assert((ImplicitInitKind == IIK_Default || ImplicitInitKind == IIK_Inherit) &&<br>
"Unhandled implicit init kind!");<br>
<br>
- QualType FieldBaseElementType =<br>
+ QualType FieldBaseElementType =<br>
SemaRef.Context.<wbr>getBaseElementType(Field-><wbr>getType());<br>
-<br>
+<br>
if (FieldBaseElementType-><wbr>isRecordType()) {<br>
InitializedEntity InitEntity =<br>
Indirect ? InitializedEntity::<wbr>InitializeMember(Indirect, nullptr,<br>
/*Implicit*/ true)<br>
: InitializedEntity::<wbr>InitializeMember(Field, nullptr,<br>
/*Implicit*/ true);<br>
- InitializationKind InitKind =<br>
+ InitializationKind InitKind =<br>
InitializationKind::<wbr>CreateDefault(Loc);<br>
<br>
InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, None);<br>
@@ -4383,10 +4386,10 @@ BuildImplicitMemberInitializer<wbr>(Sema &Sem<br>
MemberInit = SemaRef.<wbr>MaybeCreateExprWithCleanups(<wbr>MemberInit);<br>
if (MemberInit.isInvalid())<br>
return true;<br>
-<br>
+<br>
if (Indirect)<br>
CXXMemberInit = new (SemaRef.Context) CXXCtorInitializer(SemaRef.<wbr>Context,<br>
- Indirect, Loc,<br>
+ Indirect, Loc,<br>
Loc,<br>
MemberInit.get(),<br>
Loc);<br>
@@ -4400,9 +4403,9 @@ BuildImplicitMemberInitializer<wbr>(Sema &Sem<br>
<br>
if (!Field->getParent()->isUnion(<wbr>)) {<br>
if (FieldBaseElementType-><wbr>isReferenceType()) {<br>
- SemaRef.Diag(Constructor-><wbr>getLocation(),<br>
+ SemaRef.Diag(Constructor-><wbr>getLocation(),<br>
diag::err_uninitialized_<wbr>member_in_ctor)<br>
- << (int)Constructor->isImplicit()<br>
+ << (int)Constructor->isImplicit()<br>
<< SemaRef.Context.<wbr>getTagDeclType(Constructor-><wbr>getParent())<br>
<< 0 << Field->getDeclName();<br>
SemaRef.Diag(Field-><wbr>getLocation(), diag::note_declared_at);<br>
@@ -4410,27 +4413,27 @@ BuildImplicitMemberInitializer<wbr>(Sema &Sem<br>
}<br>
<br>
if (FieldBaseElementType.<wbr>isConstQualified()) {<br>
- SemaRef.Diag(Constructor-><wbr>getLocation(),<br>
+ SemaRef.Diag(Constructor-><wbr>getLocation(),<br>
diag::err_uninitialized_<wbr>member_in_ctor)<br>
- << (int)Constructor->isImplicit()<br>
+ << (int)Constructor->isImplicit()<br>
<< SemaRef.Context.<wbr>getTagDeclType(Constructor-><wbr>getParent())<br>
<< 1 << Field->getDeclName();<br>
SemaRef.Diag(Field-><wbr>getLocation(), diag::note_declared_at);<br>
return true;<br>
}<br>
}<br>
-<br>
+<br>
if (FieldBaseElementType.<wbr>hasNonTrivialObjCLifetime()) {<br>
// ARC and Weak:<br>
// Default-initialize Objective-C pointers to NULL.<br>
CXXMemberInit<br>
- = new (SemaRef.Context) CXXCtorInitializer(SemaRef.<wbr>Context, Field,<br>
- Loc, Loc,<br>
- new (SemaRef.Context) ImplicitValueInitExpr(Field-><wbr>getType()),<br>
+ = new (SemaRef.Context) CXXCtorInitializer(SemaRef.<wbr>Context, Field,<br>
+ Loc, Loc,<br>
+ new (SemaRef.Context) ImplicitValueInitExpr(Field-><wbr>getType()),<br>
Loc);<br>
return false;<br>
}<br>
-<br>
+<br>
// Nothing to initialize.<br>
CXXMemberInit = nullptr;<br>
return false;<br>
@@ -4458,13 +4461,13 @@ struct BaseAndFieldInfo {<br>
else<br>
IIK = IIK_Default;<br>
}<br>
-<br>
+<br>
bool isImplicitCopyOrMove() const {<br>
switch (IIK) {<br>
case IIK_Copy:<br>
case IIK_Move:<br>
return true;<br>
-<br>
+<br>
case IIK_Default:<br>
case IIK_Inherit:<br>
return false;<br>
@@ -4531,19 +4534,19 @@ struct BaseAndFieldInfo {<br>
static bool isIncompleteOrZeroLengthArrayT<wbr>ype(ASTContext &Context, QualType T) {<br>
if (T->isIncompleteArrayType())<br>
return true;<br>
-<br>
+<br>
while (const ConstantArrayType *ArrayT = Context.<wbr>getAsConstantArrayType(T)) {<br>
if (!ArrayT->getSize())<br>
return true;<br>
-<br>
+<br>
T = ArrayT->getElementType();<br>
}<br>
-<br>
+<br>
return false;<br>
}<br>
<br>
static bool CollectFieldInitializer(Sema &SemaRef, BaseAndFieldInfo &Info,<br>
- FieldDecl *Field,<br>
+ FieldDecl *Field,<br>
IndirectFieldDecl *Indirect = nullptr) {<br>
if (Field->isInvalidDecl())<br>
return false;<br>
@@ -4656,7 +4659,7 @@ bool Sema::SetCtorInitializers(<wbr>CXXConstr<br>
CXXRecordDecl *ClassDecl = Constructor->getParent()-><wbr>getDefinition();<br>
if (!ClassDecl)<br>
return true;<br>
-<br>
+<br>
bool HadError = false;<br>
<br>
for (unsigned i = 0; i < Initializers.size(); i++) {<br>
@@ -4755,34 +4758,34 @@ bool Sema::SetCtorInitializers(<wbr>CXXConstr<br>
// initialized.<br>
if (F->isUnnamedBitfield())<br>
continue;<br>
-<br>
+<br>
// If we're not generating the implicit copy/move constructor, then we'll<br>
// handle anonymous struct/union fields based on their individual<br>
// indirect fields.<br>
if (F->isAnonymousStructOrUnion() && !Info.isImplicitCopyOrMove())<br>
continue;<br>
-<br>
+<br>
if (CollectFieldInitializer(*<wbr>this, Info, F))<br>
HadError = true;<br>
continue;<br>
}<br>
-<br>
+<br>
// Beyond this point, we only consider default initialization.<br>
if (Info.isImplicitCopyOrMove())<br>
continue;<br>
-<br>
+<br>
if (auto *F = dyn_cast<IndirectFieldDecl>(<wbr>Mem)) {<br>
if (F->getType()-><wbr>isIncompleteArrayType()) {<br>
assert(ClassDecl-><wbr>hasFlexibleArrayMember() &&<br>
"Incomplete array type is not valid");<br>
continue;<br>
}<br>
-<br>
+<br>
// Initialize each field of an anonymous struct individually.<br>
if (CollectFieldInitializer(*<wbr>this, Info, F->getAnonField(), F))<br>
HadError = true;<br>
-<br>
- continue;<br>
+<br>
+ continue;<br>
}<br>
}<br>
<br>
@@ -4824,7 +4827,7 @@ static const void *GetKeyForMember(ASTCo<br>
CXXCtorInitializer *Member) {<br>
if (!Member-><wbr>isAnyMemberInitializer())<br>
return GetKeyForBase(Context, QualType(Member->getBaseClass(<wbr>), 0));<br>
-<br>
+<br>
return Member->getAnyMember()-><wbr>getCanonicalDecl();<br>
}<br>
<br>
@@ -4835,7 +4838,7 @@ static void DiagnoseBaseOrMemInitializer<br>
return;<br>
<br>
// Don't check initializers order unless the warning is enabled at the<br>
- // location of at least one initializer.<br>
+ // location of at least one initializer.<br>
bool ShouldCheckOrder = false;<br>
for (unsigned InitIndex = 0; InitIndex != Inits.size(); ++InitIndex) {<br>
CXXCtorInitializer *Init = Inits[InitIndex];<br>
@@ -4847,7 +4850,7 @@ static void DiagnoseBaseOrMemInitializer<br>
}<br>
if (!ShouldCheckOrder)<br>
return;<br>
-<br>
+<br>
// Build the list of bases and members in the order that they'll<br>
// actually be initialized. The explicit initializers should be in<br>
// this same order but may be missing things.<br>
@@ -4870,10 +4873,10 @@ static void DiagnoseBaseOrMemInitializer<br>
for (auto *Field : ClassDecl->fields()) {<br>
if (Field->isUnnamedBitfield())<br>
continue;<br>
-<br>
+<br>
PopulateKeysForFields(Field, IdealInitKeys);<br>
}<br>
-<br>
+<br>
unsigned NumIdealInits = IdealInitKeys.size();<br>
unsigned IdealIndex = 0;<br>
<br>
@@ -4900,7 +4903,7 @@ static void DiagnoseBaseOrMemInitializer<br>
D << 0 << PrevInit->getAnyMember()-><wbr>getDeclName();<br>
else<br>
D << 1 << PrevInit->getTypeSourceInfo()-<wbr>>getType();<br>
-<br>
+<br>
if (Init->isAnyMemberInitializer(<wbr>))<br>
D << 0 << Init->getAnyMember()-><wbr>getDeclName();<br>
else<br>
@@ -4968,7 +4971,7 @@ bool CheckRedundantUnionInit(Sema &S,<br>
S.Diag(En.second-><wbr>getSourceLocation(), diag::note_previous_<wbr>initializer)<br>
<< 0 << En.second->getSourceRange();<br>
return true;<br>
- }<br>
+ }<br>
if (!En.first) {<br>
En.first = Child;<br>
En.second = Init;<br>
@@ -5002,7 +5005,7 @@ void Sema::ActOnMemInitializers(<wbr>Decl *Co<br>
Diag(ColonLoc, diag::err_only_constructors_<wbr>take_base_inits);<br>
return;<br>
}<br>
-<br>
+<br>
// Mapping for the duplicate initializers check.<br>
// For member initializers, this is keyed with a FieldDecl*.<br>
// For base initializers, this is keyed with a Type*.<br>
@@ -5064,22 +5067,22 @@ Sema::<wbr>MarkBaseAndMemberDestructorsRe<wbr>fere<br>
// field/base declaration. That's probably good; that said, the<br>
// user might reasonably want to know why the destructor is being<br>
// emitted, and we currently don't say.<br>
-<br>
+<br>
// Non-static data members.<br>
for (auto *Field : ClassDecl->fields()) {<br>
if (Field->isInvalidDecl())<br>
continue;<br>
-<br>
+<br>
// Don't destroy incomplete or zero-length arrays.<br>
if (<wbr>isIncompleteOrZeroLengthArrayT<wbr>ype(Context, Field->getType()))<br>
continue;<br>
<br>
QualType FieldType = Context.getBaseElementType(<wbr>Field->getType());<br>
-<br>
+<br>
const RecordType* RT = FieldType->getAs<RecordType>()<wbr>;<br>
if (!RT)<br>
continue;<br>
-<br>
+<br>
CXXRecordDecl *FieldClassDecl = cast<CXXRecordDecl>(RT-><wbr>getDecl());<br>
if (FieldClassDecl-><wbr>isInvalidDecl())<br>
continue;<br>
@@ -5134,14 +5137,14 @@ Sema::<wbr>MarkBaseAndMemberDestructorsRe<wbr>fere<br>
<< Base.getType()<br>
<< Base.getSourceRange(),<br>
Context.getTypeDeclType(<wbr>ClassDecl));<br>
-<br>
+<br>
MarkFunctionReferenced(<wbr>Location, Dtor);<br>
DiagnoseUseOfDecl(Dtor, Location);<br>
}<br>
<br>
if (!VisitVirtualBases)<br>
return;<br>
-<br>
+<br>
// Virtual bases.<br>
for (const auto &VBase : ClassDecl->vbases()) {<br>
// Bases are always records in a well-formed non-dependent class.<br>
@@ -5238,12 +5241,12 @@ void Sema::DiagnoseAbstractType(<wbr>const CX<br>
// Keep a set of seen pure methods so we won't diagnose the same method<br>
// more than once.<br>
llvm::SmallPtrSet<const CXXMethodDecl *, 8> SeenPureMethods;<br>
-<br>
- for (CXXFinalOverriderMap::<wbr>iterator M = FinalOverriders.begin(),<br>
+<br>
+ for (CXXFinalOverriderMap::<wbr>iterator M = FinalOverriders.begin(),<br>
MEnd = FinalOverriders.end();<br>
- M != MEnd;<br>
+ M != MEnd;<br>
++M) {<br>
- for (OverridingMethods::iterator SO = M->second.begin(),<br>
+ for (OverridingMethods::iterator SO = M->second.begin(),<br>
SOEnd = M->second.end();<br>
SO != SOEnd; ++SO) {<br>
// C++ [class.abstract]p4:<br>
@@ -5251,7 +5254,7 @@ void Sema::DiagnoseAbstractType(<wbr>const CX<br>
// pure virtual function for which the final overrider is pure<br>
// virtual.<br>
<br>
- //<br>
+ //<br>
if (SO->second.size() != 1)<br>
continue;<br>
<br>
@@ -5261,8 +5264,8 @@ void Sema::DiagnoseAbstractType(<wbr>const CX<br>
if (!SeenPureMethods.insert(SO-><wbr>second.front().Method).second)<br>
continue;<br>
<br>
- Diag(SO->second.front().<wbr>Method->getLocation(),<br>
- diag::note_pure_virtual_<wbr>function)<br>
+ Diag(SO->second.front().<wbr>Method->getLocation(),<br>
+ diag::note_pure_virtual_<wbr>function)<br>
<< SO->second.front().Method-><wbr>getDeclName() << RD->getDeclName();<br>
}<br>
}<br>
@@ -5742,7 +5745,7 @@ static bool computeCanPassInRegisters(Se<br>
!D-><wbr>defaultedCopyConstructorIsDele<wbr>ted()) {<br>
if (!D-><wbr>hasTrivialCopyConstructor())<br>
return false;<br>
- HasNonDeletedCopyOrMove = true;<br>
+ HasNonDeletedCopyOrMove = true;<br>
}<br>
<br>
if (S.getLangOpts().CPlusPlus11 && D-><wbr>needsImplicitMoveConstructor() &&<br>
@@ -5784,7 +5787,7 @@ void Sema::CheckCompletedCXXClass(<wbr>CXXRec<br>
AbstractUsageInfo Info(*this, Record);<br>
CheckAbstractClassUsage(Info, Record);<br>
}<br>
-<br>
+<br>
// If this is not an aggregate type and has no user-declared constructor,<br>
// complain about any non-static data members of reference or const scalar<br>
// type, since they will never get initializers.<br>
@@ -5803,7 +5806,7 @@ void Sema::CheckCompletedCXXClass(<wbr>CXXRec<br>
<< Record->getTagKind() << Record;<br>
Complained = true;<br>
}<br>
-<br>
+<br>
Diag(F->getLocation(), diag::note_refconst_member_<wbr>not_initialized)<br>
<< F->getType()->isReferenceType(<wbr>)<br>
<< F->getDeclName();<br>
@@ -5813,12 +5816,12 @@ void Sema::CheckCompletedCXXClass(<wbr>CXXRec<br>
<br>
if (Record->getIdentifier()) {<br>
// C++ [class.mem]p13:<br>
- // If T is the name of a class, then each of the following shall have a<br>
+ // If T is the name of a class, then each of the following shall have a<br>
// name different from T:<br>
// - every member of every anonymous union that is a member of class T.<br>
//<br>
// C++ [class.mem]p14:<br>
- // In addition, if class T has a user-declared constructor (12.1), every<br>
+ // In addition, if class T has a user-declared constructor (12.1), every<br>
// non-static data member of class T shall have a name different from T.<br>
DeclContext::lookup_result R = Record->lookup(Record-><wbr>getDeclName());<br>
for (DeclContext::lookup_iterator I = R.begin(), E = R.end(); I != E;<br>
@@ -7818,11 +7821,11 @@ QualType Sema::<wbr>CheckConstructorDeclarato<br>
// A constructor shall not be declared with a ref-qualifier.<br>
if (FTI.hasRefQualifier()) {<br>
Diag(FTI.getRefQualifierLoc(), diag::err_ref_qualifier_<wbr>constructor)<br>
- << FTI.RefQualifierIsLValueRef<br>
+ << FTI.RefQualifierIsLValueRef<br>
<< FixItHint::CreateRemoval(FTI.<wbr>getRefQualifierLoc());<br>
D.setInvalidType();<br>
}<br>
-<br>
+<br>
// Rebuild the function type "R" without any type qualifiers (in<br>
// case any of the errors above fired) and with "void" as the<br>
// return type, since constructors don't have return types.<br>
@@ -7861,8 +7864,8 @@ void Sema::CheckConstructor(<wbr>CXXConstruct<br>
QualType ClassTy = Context.getTagDeclType(<wbr>ClassDecl);<br>
if (Context.getCanonicalType(<wbr>ParamType).getUnqualifiedType(<wbr>) == ClassTy) {<br>
SourceLocation ParamLoc = Constructor->getParamDecl(0)-><wbr>getLocation();<br>
- const char *ConstRef<br>
- = Constructor->getParamDecl(0)-><wbr>getIdentifier() ? "const &"<br>
+ const char *ConstRef<br>
+ = Constructor->getParamDecl(0)-><wbr>getIdentifier() ? "const &"<br>
: " const &";<br>
Diag(ParamLoc, diag::err_constructor_byvalue_<wbr>arg)<br>
<< FixItHint::CreateInsertion(<wbr>ParamLoc, ConstRef);<br>
@@ -7879,15 +7882,15 @@ void Sema::CheckConstructor(<wbr>CXXConstruct<br>
/// on error.<br>
bool Sema::CheckDestructor(<wbr>CXXDestructorDecl *Destructor) {<br>
CXXRecordDecl *RD = Destructor->getParent();<br>
-<br>
+<br>
if (!Destructor-><wbr>getOperatorDelete() && Destructor->isVirtual()) {<br>
SourceLocation Loc;<br>
-<br>
+<br>
if (!Destructor->isImplicit())<br>
Loc = Destructor->getLocation();<br>
else<br>
Loc = RD->getLocation();<br>
-<br>
+<br>
// If we have a virtual destructor, look up the deallocation function<br>
if (FunctionDecl *OperatorDelete =<br>
FindDeallocationFunctionForDes<wbr>tructor(Loc, RD)) {<br>
@@ -7895,7 +7898,7 @@ bool Sema::CheckDestructor(<wbr>CXXDestructor<br>
Destructor->setOperatorDelete(<wbr>OperatorDelete);<br>
}<br>
}<br>
-<br>
+<br>
return false;<br>
}<br>
<br>
@@ -7936,7 +7939,7 @@ QualType Sema::<wbr>CheckDestructorDeclarator<br>
<< "static" << SourceRange(D.getDeclSpec().<wbr>getStorageClassSpecLoc())<br>
<< SourceRange(D.<wbr>getIdentifierLoc())<br>
<< FixItHint::CreateRemoval(D.<wbr>getDeclSpec().<wbr>getStorageClassSpecLoc());<br>
-<br>
+<br>
SC = SC_None;<br>
}<br>
if (!D.isInvalidType()) {<br>
@@ -7985,7 +7988,7 @@ QualType Sema::<wbr>CheckDestructorDeclarator<br>
<< FixItHint::CreateRemoval(FTI.<wbr>getRefQualifierLoc());<br>
D.setInvalidType();<br>
}<br>
-<br>
+<br>
// Make sure we don't have any parameters.<br>
if (FTIHasNonVoidParameters(FTI)) {<br>
Diag(D.getIdentifierLoc(), diag::err_destructor_with_<wbr>params);<br>
@@ -8004,7 +8007,7 @@ QualType Sema::<wbr>CheckDestructorDeclarator<br>
// Rebuild the function type "R" without any type qualifiers or<br>
// parameters (in case any of the errors above fired) and with<br>
// "void" as the return type, since destructors don't have return<br>
- // types.<br>
+ // types.<br>
if (!D.isInvalidType())<br>
return R;<br>
<br>
@@ -8233,7 +8236,7 @@ Decl *Sema::<wbr>ActOnConversionDeclarator(CX<br>
if (FunctionTemplateDecl *ConversionTemplate<br>
= Conversion-><wbr>getDescribedFunctionTemplate()<wbr>)<br>
return ConversionTemplate;<br>
-<br>
+<br>
return Conversion;<br>
}<br>
<br>
@@ -8492,7 +8495,7 @@ Decl *Sema::ActOnStartNamespaceDef(<wbr>Scope<br>
}<br>
} else {<br>
// Anonymous namespaces.<br>
-<br>
+<br>
// Determine whether the parent already has an anonymous namespace.<br>
DeclContext *Parent = CurContext->getRedeclContext()<wbr>;<br>
if (TranslationUnitDecl *TU = dyn_cast<TranslationUnitDecl>(<wbr>Parent)) {<br>
@@ -8506,12 +8509,12 @@ Decl *Sema::ActOnStartNamespaceDef(<wbr>Scope<br>
DiagnoseNamespaceInlineMismatc<wbr>h(*this, NamespaceLoc, NamespaceLoc, II,<br>
&IsInline, PrevNS);<br>
}<br>
-<br>
+<br>
NamespaceDecl *Namespc = NamespaceDecl::Create(Context, CurContext, IsInline,<br>
StartLoc, Loc, II, PrevNS);<br>
if (IsInvalid)<br>
Namespc->setInvalidDecl();<br>
-<br>
+<br>
ProcessDeclAttributeList(<wbr>DeclRegionScope, Namespc, AttrList);<br>
AddPragmaAttributes(<wbr>DeclRegionScope, Namespc);<br>
<br>
@@ -8523,7 +8526,7 @@ Decl *Sema::ActOnStartNamespaceDef(<wbr>Scope<br>
StdNamespace = Namespc;<br>
if (AddToKnown)<br>
KnownNamespaces[Namespc] = false;<br>
-<br>
+<br>
if (II) {<br>
PushOnScopeChains(Namespc, DeclRegionScope);<br>
} else {<br>
@@ -8624,12 +8627,12 @@ NamespaceDecl *Sema::lookupStdExperiment<br>
return StdExperimentalNamespaceCache;<br>
}<br>
<br>
-/// \brief Retrieve the special "std" namespace, which may require us to<br>
+/// \brief Retrieve the special "std" namespace, which may require us to<br>
/// implicitly define the namespace.<br>
NamespaceDecl *Sema::<wbr>getOrCreateStdNamespace() {<br>
if (!StdNamespace) {<br>
// The "std" namespace has not yet been defined, so build one implicitly.<br>
- StdNamespace = NamespaceDecl::Create(Context,<br>
+ StdNamespace = NamespaceDecl::Create(Context,<br>
Context.<wbr>getTranslationUnitDecl(),<br>
/*Inline=*/false,<br>
SourceLocation(), SourceLocation(),<br>
@@ -8842,7 +8845,7 @@ Decl *Sema::ActOnUsingDirective(<wbr>Scope *S<br>
NestedNameSpecifier *Qualifier = nullptr;<br>
if (SS.isSet())<br>
Qualifier = SS.getScopeRep();<br>
-<br>
+<br>
// Lookup namespace name.<br>
LookupResult R(*this, NamespcName, IdentLoc, LookupNamespaceName);<br>
LookupParsedName(R, S, &SS);<br>
@@ -8851,18 +8854,18 @@ Decl *Sema::ActOnUsingDirective(<wbr>Scope *S<br>
<br>
if (R.empty()) {<br>
R.clear();<br>
- // Allow "using namespace std;" or "using namespace ::std;" even if<br>
+ // Allow "using namespace std;" or "using namespace ::std;" even if<br>
// "std" hasn't been defined yet, for GCC compatibility.<br>
if ((!Qualifier || Qualifier->getKind() == NestedNameSpecifier::Global) &&<br>
NamespcName->isStr("std")) {<br>
Diag(IdentLoc, diag::ext_using_undefined_std)<wbr>;<br>
R.addDecl(<wbr>getOrCreateStdNamespace());<br>
R.resolveKind();<br>
- }<br>
+ }<br>
// Otherwise, attempt typo correction.<br>
else TryNamespaceTypoCorrection(*<wbr>this, R, S, SS, IdentLoc, NamespcName);<br>
}<br>
-<br>
+<br>
if (!R.empty()) {<br>
NamedDecl *Named = R.getRepresentativeDecl();<br>
NamespaceDecl *NS = R.getAsSingle<NamespaceDecl>()<wbr>;<br>
@@ -8943,7 +8946,7 @@ Decl *Sema::ActOnUsingDeclaration(<wbr>Scope<br>
case UnqualifiedId::IK_<wbr>LiteralOperatorId:<br>
case UnqualifiedId::IK_<wbr>ConversionFunctionId:<br>
break;<br>
-<br>
+<br>
case UnqualifiedId::IK_<wbr>ConstructorName:<br>
case UnqualifiedId::IK_<wbr>ConstructorTemplateId:<br>
// C++11 inheriting constructors.<br>
@@ -9086,7 +9089,7 @@ bool Sema::CheckUsingShadowDecl(<wbr>UsingDec<br>
<br>
// If the target happens to be one of the previous declarations, we<br>
// don't have a conflict.<br>
- //<br>
+ //<br>
// FIXME: but we might be increasing its access, in which case we<br>
// should redeclare it.<br>
NamedDecl *NonTag = nullptr, *Tag = nullptr;<br>
@@ -9461,7 +9464,7 @@ NamedDecl *Sema::BuildUsingDeclaration(S<br>
IdentLoc, NameInfo.getName(),<br>
EllipsisLoc);<br>
} else {<br>
- D = UnresolvedUsingValueDecl::<wbr>Create(Context, CurContext, UsingLoc,<br>
+ D = UnresolvedUsingValueDecl::<wbr>Create(Context, CurContext, UsingLoc,<br>
QualifierLoc, NameInfo, EllipsisLoc);<br>
}<br>
D->setAccess(AS);<br>
@@ -9974,7 +9977,7 @@ Decl *Sema::ActOnAliasDeclaration(<wbr>Scope<br>
if (<wbr>DiagnoseUnexpandedParameterPac<wbr>k(Name.StartLocation, TInfo,<br>
UPPC_DeclarationType)) {<br>
Invalid = true;<br>
- TInfo = Context.<wbr>getTrivialTypeSourceInfo(<wbr>Context.IntTy,<br>
+ TInfo = Context.<wbr>getTrivialTypeSourceInfo(<wbr>Context.IntTy,<br>
TInfo->getTypeLoc().<wbr>getBeginLoc());<br>
}<br>
<br>
@@ -10137,7 +10140,7 @@ Decl *Sema::ActOnNamespaceAliasDef(<wbr>Scope<br>
/*AllowInlineNamespace*/false)<wbr>;<br>
<br>
// Find the previous declaration and check that we can redeclare it.<br>
- NamespaceAliasDecl *Prev = nullptr;<br>
+ NamespaceAliasDecl *Prev = nullptr;<br>
if (PrevR.isSingleResult()) {<br>
NamedDecl *PrevDecl = PrevR.getRepresentativeDecl();<br>
if (NamespaceAliasDecl *AD = dyn_cast<NamespaceAliasDecl>(<wbr>PrevDecl)) {<br>
@@ -10258,7 +10261,7 @@ ComputeDefaultedSpecialMemberE<wbr>xceptionSp<br>
CXXRecordDecl *ClassDecl = MD->getParent();<br>
<br>
// C++ [except.spec]p14:<br>
- // An implicitly declared special member function (Clause 12) shall have an<br>
+ // An implicitly declared special member function (Clause 12) shall have an<br>
// exception-specification. [...]<br>
SpecialMemberExceptionSpecInfo Info(S, MD, CSM, ICI, Loc);<br>
if (ClassDecl->isInvalidDecl())<br>
@@ -11123,7 +11126,7 @@ buildSingleCopyAssignRecursive<wbr>ly(Sema &S<br>
//<br>
// for (__SIZE_TYPE__ i0 = 0; i0 != array-size; ++i0)<br>
//<br>
- // that will copy each of the array elements.<br>
+ // that will copy each of the array elements.<br>
QualType SizeType = S.Context.getSizeType();<br>
<br>
// Create the iteration variable.<br>
@@ -11335,7 +11338,7 @@ static void diagnoseDeprecatedCopyOperat<br>
<br>
void Sema::<wbr>DefineImplicitCopyAssignment(<wbr>SourceLocation CurrentLocation,<br>
CXXMethodDecl *CopyAssignOperator) {<br>
- assert((CopyAssignOperator-><wbr>isDefaulted() &&<br>
+ assert((CopyAssignOperator-><wbr>isDefaulted() &&<br>
CopyAssignOperator-><wbr>isOverloadedOperator() &&<br>
CopyAssignOperator-><wbr>getOverloadedOperator() == OO_Equal &&<br>
!CopyAssignOperator-><wbr>doesThisDeclarationHaveABody() &&<br>
@@ -11369,15 +11372,15 @@ void Sema::<wbr>DefineImplicitCopyAssignment(<br>
<br>
// C++0x [class.copy]p30:<br>
// The implicitly-defined or explicitly-defaulted copy assignment operator<br>
- // for a non-union class X performs memberwise copy assignment of its<br>
- // subobjects. The direct base classes of X are assigned first, in the<br>
- // order of their declaration in the base-specifier-list, and then the<br>
- // immediate non-static data members of X are assigned, in the order in<br>
+ // for a non-union class X performs memberwise copy assignment of its<br>
+ // subobjects. The direct base classes of X are assigned first, in the<br>
+ // order of their declaration in the base-specifier-list, and then the<br>
+ // immediate non-static data members of X are assigned, in the order in<br>
// which they were declared in the class definition.<br>
-<br>
+<br>
// The statements that form the synthesized function body.<br>
SmallVector<Stmt*, 8> Statements;<br>
-<br>
+<br>
// The parameter for the "other" object, which we are copying from.<br>
ParmVarDecl *Other = CopyAssignOperator-><wbr>getParamDecl(0);<br>
Qualifiers OtherQuals = Other->getType().<wbr>getQualifiers();<br>
@@ -11387,7 +11390,7 @@ void Sema::<wbr>DefineImplicitCopyAssignment(<br>
OtherRefType = OtherRef->getPointeeType();<br>
OtherQuals = OtherRefType.getQualifiers();<br>
}<br>
-<br>
+<br>
// Our location for everything implicitly-generated.<br>
SourceLocation Loc = CopyAssignOperator->getLocEnd(<wbr>).isValid()<br>
? CopyAssignOperator->getLocEnd(<wbr>)<br>
@@ -11398,7 +11401,7 @@ void Sema::<wbr>DefineImplicitCopyAssignment(<br>
<br>
// Builds the "this" pointer.<br>
ThisBuilder This;<br>
-<br>
+<br>
// Assign base classes.<br>
bool Invalid = false;<br>
for (auto &Base : ClassDecl->bases()) {<br>
@@ -11434,11 +11437,11 @@ void Sema::<wbr>DefineImplicitCopyAssignment(<br>
CopyAssignOperator-><wbr>setInvalidDecl();<br>
return;<br>
}<br>
-<br>
+<br>
// Success! Record the copy.<br>
Statements.push_back(Copy.<wbr>getAs<Expr>());<br>
}<br>
-<br>
+<br>
// Assign non-static members.<br>
for (auto *Field : ClassDecl->fields()) {<br>
// FIXME: We should form some kind of AST representation for the implied<br>
@@ -11459,28 +11462,28 @@ void Sema::<wbr>DefineImplicitCopyAssignment(<br>
Invalid = true;<br>
continue;<br>
}<br>
-<br>
+<br>
// Check for members of const-qualified, non-class type.<br>
QualType BaseType = Context.getBaseElementType(<wbr>Field->getType());<br>
if (!BaseType->getAs<RecordType>(<wbr>) && BaseType.isConstQualified()) {<br>
Diag(ClassDecl->getLocation(), diag::err_uninitialized_<wbr>member_for_assign)<br>
<< Context.getTagDeclType(<wbr>ClassDecl) << 1 << Field->getDeclName();<br>
Diag(Field->getLocation(), diag::note_declared_at);<br>
- Invalid = true;<br>
+ Invalid = true;<br>
continue;<br>
}<br>
<br>
// Suppress assigning zero-width bitfields.<br>
if (Field->isBitField() && Field->getBitWidthValue(<wbr>Context) == 0)<br>
continue;<br>
-<br>
+<br>
QualType FieldType = Field->getType().<wbr>getNonReferenceType();<br>
if (FieldType-><wbr>isIncompleteArrayType()) {<br>
- assert(ClassDecl-><wbr>hasFlexibleArrayMember() &&<br>
+ assert(ClassDecl-><wbr>hasFlexibleArrayMember() &&<br>
"Incomplete array type is not valid");<br>
continue;<br>
}<br>
-<br>
+<br>
// Build references to the field in the object we're copying from and to.<br>
CXXScopeSpec SS; // Intentionally empty<br>
LookupResult MemberLookup(*this, Field->getDeclName(), Loc,<br>
@@ -11501,7 +11504,7 @@ void Sema::<wbr>DefineImplicitCopyAssignment(<br>
CopyAssignOperator-><wbr>setInvalidDecl();<br>
return;<br>
}<br>
-<br>
+<br>
// Success! Record the copy.<br>
Statements.push_back(Copy.<wbr>getAs<Stmt>());<br>
}<br>
@@ -11509,7 +11512,7 @@ void Sema::<wbr>DefineImplicitCopyAssignment(<br>
if (!Invalid) {<br>
// Add a "return *this;"<br>
ExprResult ThisObj = CreateBuiltinUnaryOp(Loc, UO_Deref, This.build(*this, Loc));<br>
-<br>
+<br>
StmtResult Return = BuildReturnStmt(Loc, ThisObj.get());<br>
if (Return.isInvalid())<br>
Invalid = true;<br>
@@ -11697,7 +11700,7 @@ static void checkMoveAssignmentForRepeat<br>
<br>
void Sema::<wbr>DefineImplicitMoveAssignment(<wbr>SourceLocation CurrentLocation,<br>
CXXMethodDecl *MoveAssignOperator) {<br>
- assert((MoveAssignOperator-><wbr>isDefaulted() &&<br>
+ assert((MoveAssignOperator-><wbr>isDefaulted() &&<br>
MoveAssignOperator-><wbr>isOverloadedOperator() &&<br>
MoveAssignOperator-><wbr>getOverloadedOperator() == OO_Equal &&<br>
!MoveAssignOperator-><wbr>doesThisDeclarationHaveABody() &&<br>
@@ -11711,7 +11714,7 @@ void Sema::<wbr>DefineImplicitMoveAssignment(<br>
MoveAssignOperator-><wbr>setInvalidDecl();<br>
return;<br>
}<br>
-<br>
+<br>
// C++0x [class.copy]p28:<br>
// The implicitly-defined or move assignment operator for a non-union class<br>
// X performs memberwise move assignment of its subobjects. The direct base<br>
@@ -11833,21 +11836,21 @@ void Sema::<wbr>DefineImplicitMoveAssignment(<br>
Diag(ClassDecl->getLocation(), diag::err_uninitialized_<wbr>member_for_assign)<br>
<< Context.getTagDeclType(<wbr>ClassDecl) << 1 << Field->getDeclName();<br>
Diag(Field->getLocation(), diag::note_declared_at);<br>
- Invalid = true;<br>
+ Invalid = true;<br>
continue;<br>
}<br>
<br>
// Suppress assigning zero-width bitfields.<br>
if (Field->isBitField() && Field->getBitWidthValue(<wbr>Context) == 0)<br>
continue;<br>
-<br>
+<br>
QualType FieldType = Field->getType().<wbr>getNonReferenceType();<br>
if (FieldType-><wbr>isIncompleteArrayType()) {<br>
- assert(ClassDecl-><wbr>hasFlexibleArrayMember() &&<br>
+ assert(ClassDecl-><wbr>hasFlexibleArrayMember() &&<br>
"Incomplete array type is not valid");<br>
continue;<br>
}<br>
-<br>
+<br>
// Build references to the field in the object we're copying from and to.<br>
LookupResult MemberLookup(*this, Field->getDeclName(), Loc,<br>
LookupMemberName);<br>
@@ -12161,26 +12164,26 @@ void Sema::<wbr>DefineImplicitLambdaToFunctio<br>
SourceLocation CurrentLocation,<br>
CXXConversionDecl *Conv) {<br>
SynthesizedFunctionScope Scope(*this, Conv);<br>
-<br>
+<br>
CXXRecordDecl *Lambda = Conv->getParent();<br>
CXXMethodDecl *CallOp = Lambda->getLambdaCallOperator(<wbr>);<br>
// If we are defining a specialization of a conversion to function-ptr<br>
// cache the deduced template arguments for this specialization<br>
// so that we can use them to retrieve the corresponding call-operator<br>
- // and static-invoker.<br>
+ // and static-invoker.<br>
const TemplateArgumentList *DeducedTemplateArgs = nullptr;<br>
<br>
// Retrieve the corresponding call-operator specialization.<br>
if (Lambda->isGenericLambda()) {<br>
assert(Conv-><wbr>isFunctionTemplateSpecializati<wbr>on());<br>
- FunctionTemplateDecl *CallOpTemplate =<br>
+ FunctionTemplateDecl *CallOpTemplate =<br>
CallOp-><wbr>getDescribedFunctionTemplate()<wbr>;<br>
DeducedTemplateArgs = Conv-><wbr>getTemplateSpecializationArgs(<wbr>);<br>
void *InsertPos = nullptr;<br>
FunctionDecl *CallOpSpec = CallOpTemplate-><wbr>findSpecialization(<br>
DeducedTemplateArgs->asArray()<wbr>,<br>
InsertPos);<br>
- assert(CallOpSpec &&<br>
+ assert(CallOpSpec &&<br>
"Conversion operator must have a corresponding call operator");<br>
CallOp = cast<CXXMethodDecl>(<wbr>CallOpSpec);<br>
}<br>
@@ -12196,15 +12199,15 @@ void Sema::<wbr>DefineImplicitLambdaToFunctio<br>
CXXMethodDecl *Invoker = Lambda-><wbr>getLambdaStaticInvoker();<br>
// ... and get the corresponding specialization for a generic lambda.<br>
if (Lambda->isGenericLambda()) {<br>
- assert(DeducedTemplateArgs &&<br>
+ assert(DeducedTemplateArgs &&<br>
"Must have deduced template arguments from Conversion Operator");<br>
- FunctionTemplateDecl *InvokeTemplate =<br>
+ FunctionTemplateDecl *InvokeTemplate =<br>
Invoker-><wbr>getDescribedFunctionTemplate()<wbr>;<br>
void *InsertPos = nullptr;<br>
FunctionDecl *InvokeSpec = InvokeTemplate-><wbr>findSpecialization(<br>
DeducedTemplateArgs->asArray()<wbr>,<br>
InsertPos);<br>
- assert(InvokeSpec &&<br>
+ assert(InvokeSpec &&<br>
"Must have a corresponding static invoker specialization");<br>
Invoker = cast<CXXMethodDecl>(<wbr>InvokeSpec);<br>
}<br>
@@ -12219,13 +12222,13 @@ void Sema::<wbr>DefineImplicitLambdaToFunctio<br>
<br>
Conv->markUsed(Context);<br>
Conv->setReferenced();<br>
-<br>
+<br>
// Fill in the __invoke function with a dummy implementation. IR generation<br>
// will fill in the actual details.<br>
Invoker->markUsed(Context);<br>
Invoker->setReferenced();<br>
Invoker->setBody(new (Context) CompoundStmt(Conv-><wbr>getLocation()));<br>
-<br>
+<br>
if (ASTMutationListener *L = getASTMutationListener()) {<br>
L-><wbr>CompletedImplicitDefinition(<wbr>Conv);<br>
L-><wbr>CompletedImplicitDefinition(<wbr>Invoker);<br>
@@ -12236,16 +12239,16 @@ void Sema::<wbr>DefineImplicitLambdaToFunctio<br>
<br>
void Sema::<wbr>DefineImplicitLambdaToBlockPoi<wbr>nterConversion(<br>
SourceLocation CurrentLocation,<br>
- CXXConversionDecl *Conv)<br>
+ CXXConversionDecl *Conv)<br>
{<br>
assert(!Conv->getParent()-><wbr>isGenericLambda());<br>
<br>
SynthesizedFunctionScope Scope(*this, Conv);<br>
-<br>
+<br>
// Copy-initialize the lambda object as needed to capture it.<br>
Expr *This = ActOnCXXThis(CurrentLocation).<wbr>get();<br>
Expr *DerefThis =CreateBuiltinUnaryOp(<wbr>CurrentLocation, UO_Deref, This).get();<br>
-<br>
+<br>
ExprResult BuildBlock = BuildBlockForLambdaConversion(<wbr>CurrentLocation,<br>
Conv->getLocation(),<br>
Conv, DerefThis);<br>
@@ -12280,29 +12283,29 @@ void Sema::<wbr>DefineImplicitLambdaToBlockPo<br>
Conv->getLocation(),<br>
Conv->getLocation()));<br>
Conv->markUsed(Context);<br>
-<br>
+<br>
// We're done; notify the mutation listener, if any.<br>
if (ASTMutationListener *L = getASTMutationListener()) {<br>
L-><wbr>CompletedImplicitDefinition(<wbr>Conv);<br>
}<br>
}<br>
<br>
-/// \brief Determine whether the given list arguments contains exactly one<br>
+/// \brief Determine whether the given list arguments contains exactly one<br>
/// "real" (non-default) argument.<br>
static bool hasOneRealArgument(<wbr>MultiExprArg Args) {<br>
switch (Args.size()) {<br>
case 0:<br>
return false;<br>
-<br>
+<br>
default:<br>
if (!Args[1]->isDefaultArgument()<wbr>)<br>
return false;<br>
-<br>
+<br>
// fall through<br>
case 1:<br>
return !Args[0]->isDefaultArgument();<br>
}<br>
-<br>
+<br>
return false;<br>
}<br>
<br>
@@ -12359,7 +12362,7 @@ Sema::BuildCXXConstructExpr(<wbr>SourceLocati<br>
if (auto *Shadow = dyn_cast<<wbr>ConstructorUsingShadowDecl>(<wbr>FoundDecl)) {<br>
Constructor = findInheritingConstructor(<wbr>ConstructLoc, Constructor, Shadow);<br>
if (DiagnoseUseOfDecl(<wbr>Constructor, ConstructLoc))<br>
- return ExprError();<br>
+ return ExprError();<br>
}<br>
<br>
return BuildCXXConstructExpr(<br>
@@ -12503,7 +12506,7 @@ void Sema::<wbr>FinalizeVarWithDestructor(Var<br>
/// to form a proper call to this constructor.<br>
///<br>
/// \returns true if an error occurred, false otherwise.<br>
-bool<br>
+bool<br>
Sema::CompleteConstructorCall(<wbr>CXXConstructorDecl *Constructor,<br>
MultiExprArg ArgsPtr,<br>
SourceLocation Loc,<br>
@@ -12514,7 +12517,7 @@ Sema::CompleteConstructorCall(<wbr>CXXConstru<br>
unsigned NumArgs = ArgsPtr.size();<br>
Expr **Args = ArgsPtr.data();<br>
<br>
- const FunctionProtoType *Proto<br>
+ const FunctionProtoType *Proto<br>
= Constructor->getType()->getAs<<wbr>FunctionProtoType>();<br>
assert(Proto && "Constructor without a prototype?");<br>
unsigned NumParams = Proto->getNumParams();<br>
@@ -12525,7 +12528,7 @@ Sema::CompleteConstructorCall(<wbr>CXXConstru<br>
else<br>
ConvertedArgs.reserve(NumArgs)<wbr>;<br>
<br>
- VariadicCallType CallType =<br>
+ VariadicCallType CallType =<br>
Proto->isVariadic() ? VariadicConstructor : VariadicDoesNotApply;<br>
SmallVector<Expr *, 8> AllArgs;<br>
bool Invalid = GatherArgumentsForCall(Loc, Constructor,<br>
@@ -12546,22 +12549,22 @@ Sema::CompleteConstructorCall(<wbr>CXXConstru<br>
}<br>
<br>
static inline bool<br>
-<wbr>CheckOperatorNewDeleteDeclarat<wbr>ionScope(Sema &SemaRef,<br>
+<wbr>CheckOperatorNewDeleteDeclarat<wbr>ionScope(Sema &SemaRef,<br>
const FunctionDecl *FnDecl) {<br>
const DeclContext *DC = FnDecl->getDeclContext()-><wbr>getRedeclContext();<br>
if (isa<NamespaceDecl>(DC)) {<br>
- return SemaRef.Diag(FnDecl-><wbr>getLocation(),<br>
+ return SemaRef.Diag(FnDecl-><wbr>getLocation(),<br>
diag::err_operator_new_delete_<wbr>declared_in_namespace)<br>
<< FnDecl->getDeclName();<br>
}<br>
-<br>
- if (isa<TranslationUnitDecl>(DC) &&<br>
+<br>
+ if (isa<TranslationUnitDecl>(DC) &&<br>
FnDecl->getStorageClass() == SC_Static) {<br>
return SemaRef.Diag(FnDecl-><wbr>getLocation(),<br>
diag::err_operator_new_delete_<wbr>declared_static)<br>
<< FnDecl->getDeclName();<br>
}<br>
-<br>
+<br>
return false;<br>
}<br>
<br>
@@ -12583,21 +12586,21 @@ CheckOperatorNewDeleteTypes(<wbr>Sema &SemaRe<br>
// Check that the result type is what we expect.<br>
if (SemaRef.Context.<wbr>getCanonicalType(ResultType) != ExpectedResultType)<br>
return SemaRef.Diag(FnDecl-><wbr>getLocation(),<br>
- diag::err_operator_new_delete_<wbr>invalid_result_type)<br>
+ diag::err_operator_new_delete_<wbr>invalid_result_type)<br>
<< FnDecl->getDeclName() << ExpectedResultType;<br>
-<br>
+<br>
// A function template must have at least 2 parameters.<br>
if (FnDecl-><wbr>getDescribedFunctionTemplate() && FnDecl->getNumParams() < 2)<br>
return SemaRef.Diag(FnDecl-><wbr>getLocation(),<br>
diag::err_operator_new_delete_<wbr>template_too_few_parameters)<br>
<< FnDecl->getDeclName();<br>
-<br>
+<br>
// The function decl must have at least 1 parameter.<br>
if (FnDecl->getNumParams() == 0)<br>
return SemaRef.Diag(FnDecl-><wbr>getLocation(),<br>
diag::err_operator_new_delete_<wbr>too_few_parameters)<br>
<< FnDecl->getDeclName();<br>
-<br>
+<br>
// Check the first parameter type is not dependent.<br>
QualType FirstParamType = FnDecl->getParamDecl(0)-><wbr>getType();<br>
if (FirstParamType-><wbr>isDependentType())<br>
@@ -12605,11 +12608,11 @@ CheckOperatorNewDeleteTypes(<wbr>Sema &SemaRe<br>
<< FnDecl->getDeclName() << ExpectedFirstParamType;<br>
<br>
// Check that the first parameter type is what we expect.<br>
- if (SemaRef.Context.<wbr>getCanonicalType(<wbr>FirstParamType).<wbr>getUnqualifiedType() !=<br>
+ if (SemaRef.Context.<wbr>getCanonicalType(<wbr>FirstParamType).<wbr>getUnqualifiedType() !=<br>
ExpectedFirstParamType)<br>
return SemaRef.Diag(FnDecl-><wbr>getLocation(), InvalidParamTypeDiag)<br>
<< FnDecl->getDeclName() << ExpectedFirstParamType;<br>
-<br>
+<br>
return false;<br>
}<br>
<br>
@@ -12617,18 +12620,18 @@ static bool<br>
CheckOperatorNewDeclaration(<wbr>Sema &SemaRef, const FunctionDecl *FnDecl) {<br>
// C++ [basic.stc.dynamic.allocation]<wbr>p1:<br>
// A program is ill-formed if an allocation function is declared in a<br>
- // namespace scope other than global scope or declared static in global<br>
+ // namespace scope other than global scope or declared static in global<br>
// scope.<br>
if (<wbr>CheckOperatorNewDeleteDeclarat<wbr>ionScope(SemaRef, FnDecl))<br>
return true;<br>
<br>
- CanQualType SizeTy =<br>
+ CanQualType SizeTy =<br>
SemaRef.Context.<wbr>getCanonicalType(SemaRef.<wbr>Context.getSizeType());<br>
<br>
// C++ [basic.stc.dynamic.allocation]<wbr>p1:<br>
- // The return type shall be void*. The first parameter shall have type<br>
+ // The return type shall be void*. The first parameter shall have type<br>
// std::size_t.<br>
- if (CheckOperatorNewDeleteTypes(<wbr>SemaRef, FnDecl, SemaRef.Context.VoidPtrTy,<br>
+ if (CheckOperatorNewDeleteTypes(<wbr>SemaRef, FnDecl, SemaRef.Context.VoidPtrTy,<br>
SizeTy,<br>
diag::err_operator_new_<wbr>dependent_param_type,<br>
diag::err_operator_new_param_<wbr>type))<br>
@@ -12648,15 +12651,15 @@ static bool<br>
CheckOperatorDeleteDeclaration<wbr>(Sema &SemaRef, FunctionDecl *FnDecl) {<br>
// C++ [basic.stc.dynamic.<wbr>deallocation]p1:<br>
// A program is ill-formed if deallocation functions are declared in a<br>
- // namespace scope other than global scope or declared static in global<br>
+ // namespace scope other than global scope or declared static in global<br>
// scope.<br>
if (<wbr>CheckOperatorNewDeleteDeclarat<wbr>ionScope(SemaRef, FnDecl))<br>
return true;<br>
<br>
// C++ [basic.stc.dynamic.<wbr>deallocation]p2:<br>
- // Each deallocation function shall return void and its first parameter<br>
+ // Each deallocation function shall return void and its first parameter<br>
// shall be void*.<br>
- if (CheckOperatorNewDeleteTypes(<wbr>SemaRef, FnDecl, SemaRef.Context.VoidTy,<br>
+ if (CheckOperatorNewDeleteTypes(<wbr>SemaRef, FnDecl, SemaRef.Context.VoidTy,<br>
SemaRef.Context.VoidPtrTy,<br>
diag::err_operator_delete_<wbr>dependent_param_type,<br>
diag::err_operator_delete_<wbr>param_type))<br>
@@ -12682,7 +12685,7 @@ bool Sema::<wbr>CheckOverloadedOperatorDeclar<br>
// explicitly stated in 3.7.3.<br>
if (Op == OO_Delete || Op == OO_Array_Delete)<br>
return CheckOperatorDeleteDeclaration<wbr>(*this, FnDecl);<br>
-<br>
+<br>
if (Op == OO_New || Op == OO_Array_New)<br>
return CheckOperatorNewDeclaration(*<wbr>this, FnDecl);<br>
<br>
@@ -13085,7 +13088,7 @@ VarDecl *Sema::<wbr>BuildExceptionDeclaration<br>
IdentifierInfo *Name) {<br>
bool Invalid = false;<br>
QualType ExDeclType = TInfo->getType();<br>
-<br>
+<br>
// Arrays and functions decay.<br>
if (ExDeclType->isArrayType())<br>
ExDeclType = Context.getArrayDecayedType(<wbr>ExDeclType);<br>
@@ -13149,7 +13152,7 @@ VarDecl *Sema::<wbr>BuildExceptionDeclaration<br>
VarDecl *ExDecl = VarDecl::Create(Context, CurContext, StartLoc, Loc, Name,<br>
ExDeclType, TInfo, SC_None);<br>
ExDecl->setExceptionVariable(<wbr>true);<br>
-<br>
+<br>
// In ARC, infer 'retaining' for variables of retainable type.<br>
if (getLangOpts().<wbr>ObjCAutoRefCount && inferObjCARCLifetime(ExDecl))<br>
Invalid = true;<br>
@@ -13190,13 +13193,13 @@ VarDecl *Sema::<wbr>BuildExceptionDeclaration<br>
Expr *init = MaybeCreateExprWithCleanups(<wbr>construct);<br>
ExDecl->setInit(init);<br>
}<br>
-<br>
+<br>
// And make sure it's destructable.<br>
FinalizeVarWithDestructor(<wbr>ExDecl, recordType);<br>
}<br>
}<br>
}<br>
-<br>
+<br>
if (Invalid)<br>
ExDecl->setInvalidDecl();<br>
<br>
@@ -13212,7 +13215,7 @@ Decl *Sema::<wbr>ActOnExceptionDeclarator(Sco<br>
// Check for unexpanded parameter packs.<br>
if (<wbr>DiagnoseUnexpandedParameterPac<wbr>k(D.getIdentifierLoc(), TInfo,<br>
UPPC_ExceptionType)) {<br>
- TInfo = Context.<wbr>getTrivialTypeSourceInfo(<wbr>Context.IntTy,<br>
+ TInfo = Context.<wbr>getTrivialTypeSourceInfo(<wbr>Context.IntTy,<br>
D.getIdentifierLoc());<br>
Invalid = true;<br>
}<br>
@@ -13338,10 +13341,10 @@ FriendDecl *Sema::CheckFriendTypeDecl(So<br>
SourceLocation FriendLoc,<br>
TypeSourceInfo *TSInfo) {<br>
assert(TSInfo && "NULL TypeSourceInfo for friend type declaration");<br>
-<br>
+<br>
QualType T = TSInfo->getType();<br>
SourceRange TypeRange = TSInfo->getTypeLoc().<wbr>getLocalSourceRange();<br>
-<br>
+<br>
// C++03 [class.friend]p2:<br>
// An elaborated-type-specifier shall be used in a friend declaration<br>
// for a class.*<br>
@@ -13385,7 +13388,7 @@ FriendDecl *Sema::CheckFriendTypeDecl(So<br>
<< T<br>
<< TypeRange;<br>
}<br>
-<br>
+<br>
// C++11 [class.friend]p3:<br>
// A friend declaration that does not declare a function shall have one<br>
// of the following forms:<br>
@@ -13498,9 +13501,9 @@ Decl *Sema::<wbr>ActOnTemplatedFriendTag(Scop<br>
CurContext->addDecl(Friend);<br>
return Friend;<br>
}<br>
-<br>
+<br>
assert(SS.isNotEmpty() && "valid templated tag with no SS and no direct?");<br>
-<br>
+<br>
<br>
<br>
// Handle the case of a templated-scope friend class. e.g.<br>
@@ -13580,7 +13583,7 @@ Decl *Sema::ActOnFriendTypeDecl(<wbr>Scope *S<br>
<< DS.getSourceRange();<br>
return nullptr;<br>
}<br>
-<br>
+<br>
// C++98 [class.friend]p1: A friend of a class is a function<br>
// or class that is not a member of the class . . .<br>
// This is fixed in DR77, which just barely didn't make the C++03<br>
@@ -13600,7 +13603,7 @@ Decl *Sema::ActOnFriendTypeDecl(<wbr>Scope *S<br>
DS.getFriendSpecLoc());<br>
else<br>
D = CheckFriendTypeDecl(Loc, DS.getFriendSpecLoc(), TSI);<br>
-<br>
+<br>
if (!D)<br>
return nullptr;<br>
<br>
@@ -13800,15 +13803,15 @@ NamedDecl *Sema::ActOnFriendFunctionDecl<br>
getLangOpts().CPlusPlus11 ?<br>
diag::warn_cxx98_compat_<wbr>friend_is_member :<br>
diag::err_friend_is_member);<br>
-<br>
+<br>
if (D.isFunctionDefinition()) {<br>
// C++ [class.friend]p6:<br>
- // A function can be defined in a friend declaration of a class if and<br>
+ // A function can be defined in a friend declaration of a class if and<br>
// only if the class is a non-local class (9.8), the function name is<br>
// unqualified, and the function has namespace scope.<br>
SemaDiagnosticBuilder DB<br>
= Diag(SS.getRange().getBegin(), diag::err_qualified_friend_<wbr>def);<br>
-<br>
+<br>
DB << SS.getScopeRep();<br>
if (DC->isFileContext())<br>
DB << FixItHint::CreateRemoval(SS.<wbr>getRange());<br>
@@ -13823,13 +13826,13 @@ NamedDecl *Sema::ActOnFriendFunctionDecl<br>
} else {<br>
if (D.isFunctionDefinition()) {<br>
// C++ [class.friend]p6:<br>
- // A function can be defined in a friend declaration of a class if and<br>
+ // A function can be defined in a friend declaration of a class if and<br>
// only if the class is a non-local class (9.8), the function name is<br>
// unqualified, and the function has namespace scope.<br>
Diag(SS.getRange().getBegin(), diag::err_qualified_friend_<wbr>def)<br>
<< SS.getScopeRep();<br>
}<br>
-<br>
+<br>
DC = CurContext;<br>
assert(isa<CXXRecordDecl>(DC) && "friend declaration not in class?");<br>
}<br>
@@ -13865,7 +13868,7 @@ NamedDecl *Sema::ActOnFriendFunctionDecl<br>
}<br>
<br>
// FIXME: This is an egregious hack to cope with cases where the scope stack<br>
- // does not contain the declaration context, i.e., in an out-of-line<br>
+ // does not contain the declaration context, i.e., in an out-of-line<br>
// definition of a class.<br>
Scope FakeDCScope(S, Scope::DeclScope, Diags);<br>
if (!DCScope) {<br>
@@ -14316,7 +14319,7 @@ DeclResult Sema::ActOnCXXConditionDeclar<br>
void Sema::LoadExternalVTableUses() {<br>
if (!ExternalSource)<br>
return;<br>
-<br>
+<br>
SmallVector<ExternalVTableUse, 4> VTables;<br>
ExternalSource-><wbr>ReadUsedVTables(VTables);<br>
SmallVector<VTableUse, 4> NewUses;<br>
@@ -14329,11 +14332,11 @@ void Sema::LoadExternalVTableUses() {<br>
Pos->second = true;<br>
continue;<br>
}<br>
-<br>
+<br>
VTablesUsed[VTables[I].Record] = VTables[I].DefinitionRequired;<br>
NewUses.push_back(VTableUse(<wbr>VTables[I].Record, VTables[I].Location));<br>
}<br>
-<br>
+<br>
VTableUses.insert(VTableUses.<wbr>begin(), NewUses.begin(), NewUses.end());<br>
}<br>
<br>
@@ -14540,17 +14543,17 @@ void Sema::SetIvarInitializers(<wbr>ObjCImple<br>
FieldDecl *Field = ivars[i];<br>
if (Field->isInvalidDecl())<br>
continue;<br>
-<br>
+<br>
CXXCtorInitializer *Member;<br>
InitializedEntity InitEntity = InitializedEntity::<wbr>InitializeMember(Field);<br>
- InitializationKind InitKind =<br>
+ InitializationKind InitKind =<br>
InitializationKind::<wbr>CreateDefault(<wbr>ObjCImplementation-><wbr>getLocation());<br>
<br>
InitializationSequence InitSeq(*this, InitEntity, InitKind, None);<br>
ExprResult MemberInit =<br>
InitSeq.Perform(*this, InitEntity, InitKind, None);<br>
MemberInit = MaybeCreateExprWithCleanups(<wbr>MemberInit);<br>
- // Note, MemberInit could actually come back empty if no initialization<br>
+ // Note, MemberInit could actually come back empty if no initialization<br>
// is required (e.g., because it would call a trivial default constructor)<br>
if (!MemberInit.get() || MemberInit.isInvalid())<br>
continue;<br>
@@ -14561,7 +14564,7 @@ void Sema::SetIvarInitializers(<wbr>ObjCImple<br>
MemberInit.getAs<Expr>(),<br>
SourceLocation());<br>
AllToInit.push_back(Member);<br>
-<br>
+<br>
// Be sure that the destructor is accessible and is marked as referenced.<br>
if (const RecordType *RecordTy =<br>
Context.getBaseElementType(<wbr>Field->getType())<br>
@@ -14573,9 +14576,9 @@ void Sema::SetIvarInitializers(<wbr>ObjCImple<br>
PDiag(diag::err_access_dtor_<wbr>ivar)<br>
<< Context.getBaseElementType(<wbr>Field->getType()));<br>
}<br>
- }<br>
+ }<br>
}<br>
- ObjCImplementation-><wbr>setIvarInitializers(Context,<br>
+ ObjCImplementation-><wbr>setIvarInitializers(Context,<br>
AllToInit.data(), AllToInit.size());<br>
}<br>
}<br>
@@ -14643,7 +14646,7 @@ void DelegatingCycleHelper(<wbr>CXXConstructo<br>
DelegatingCycleHelper(Target, Valid, Invalid, Current, S);<br>
}<br>
}<br>
-<br>
+<br>
<br>
void Sema::<wbr>CheckDelegatingCtorCycles() {<br>
llvm::SmallSet<<wbr>CXXConstructorDecl*, 4> Valid, Invalid, Current;<br>
@@ -14664,10 +14667,10 @@ namespace {<br>
/// \brief AST visitor that finds references to the 'this' expression.<br>
class FindCXXThisExpr : public RecursiveASTVisitor<<wbr>FindCXXThisExpr> {<br>
Sema &S;<br>
-<br>
+<br>
public:<br>
explicit FindCXXThisExpr(Sema &S) : S(S) { }<br>
-<br>
+<br>
bool VisitCXXThisExpr(CXXThisExpr *E) {<br>
S.Diag(E->getLocation(), diag::err_this_static_member_<wbr>func)<br>
<< E->isImplicit();<br>
@@ -14680,22 +14683,22 @@ bool Sema::<wbr>checkThisInStaticMemberFuncti<br>
TypeSourceInfo *TSInfo = Method->getTypeSourceInfo();<br>
if (!TSInfo)<br>
return false;<br>
-<br>
+<br>
TypeLoc TL = TSInfo->getTypeLoc();<br>
FunctionProtoTypeLoc ProtoTL = TL.getAs<FunctionProtoTypeLoc><wbr>();<br>
if (!ProtoTL)<br>
return false;<br>
-<br>
+<br>
// C++11 [expr.prim.general]p3:<br>
- // [The expression this] shall not appear before the optional<br>
- // cv-qualifier-seq and it shall not appear within the declaration of a<br>
+ // [The expression this] shall not appear before the optional<br>
+ // cv-qualifier-seq and it shall not appear within the declaration of a<br>
// static member function (although its type and value category are defined<br>
// within a static member function as they are within a non-static member<br>
// function). [ Note: this is because declaration matching does not occur<br>
// until the complete declarator is known. - end note ]<br>
const FunctionProtoType *Proto = ProtoTL.getTypePtr();<br>
FindCXXThisExpr Finder(*this);<br>
-<br>
+<br>
// If the return type came after the cv-qualifier-seq, check it now.<br>
if (Proto->hasTrailingReturn() &&<br>
!Finder.TraverseTypeLoc(<wbr>ProtoTL.getReturnLoc()))<br>
@@ -14704,7 +14707,7 @@ bool Sema::<wbr>checkThisInStaticMemberFuncti<br>
// Check the exception specification.<br>
if (<wbr>checkThisInStaticMemberFunctio<wbr>nExceptionSpec(Method))<br>
return true;<br>
-<br>
+<br>
return checkThisInStaticMemberFunctio<wbr>nAttributes(Method);<br>
}<br>
<br>
@@ -14712,12 +14715,12 @@ bool Sema::<wbr>checkThisInStaticMemberFuncti<br>
TypeSourceInfo *TSInfo = Method->getTypeSourceInfo();<br>
if (!TSInfo)<br>
return false;<br>
-<br>
+<br>
TypeLoc TL = TSInfo->getTypeLoc();<br>
FunctionProtoTypeLoc ProtoTL = TL.getAs<FunctionProtoTypeLoc><wbr>();<br>
if (!ProtoTL)<br>
return false;<br>
-<br>
+<br>
const FunctionProtoType *Proto = ProtoTL.getTypePtr();<br>
FindCXXThisExpr Finder(*this);<br>
<br>
@@ -14730,12 +14733,12 @@ bool Sema::<wbr>checkThisInStaticMemberFuncti<br>
case EST_MSAny:<br>
case EST_None:<br>
break;<br>
-<br>
+<br>
case EST_ComputedNoexcept:<br>
if (!Finder.TraverseStmt(Proto-><wbr>getNoexceptExpr()))<br>
return true;<br>
LLVM_FALLTHROUGH;<br>
-<br>
+<br>
case EST_Dynamic:<br>
for (const auto &E : Proto->exceptions()) {<br>
if (!Finder.TraverseType(E))<br>
@@ -14784,13 +14787,13 @@ bool Sema::<wbr>checkThisInStaticMemberFuncti<br>
<br>
if (Arg && !Finder.TraverseStmt(Arg))<br>
return true;<br>
-<br>
+<br>
for (unsigned I = 0, N = Args.size(); I != N; ++I) {<br>
if (!Finder.TraverseStmt(Args[I])<wbr>)<br>
return true;<br>
}<br>
}<br>
-<br>
+<br>
return false;<br>
}<br>
<br>
<br>
Modified: cfe/trunk/test/SemaCXX/ms-<wbr>interface.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/ms-interface.cpp?rev=313828&r1=313827&r2=313828&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>SemaCXX/ms-interface.cpp?rev=<wbr>313828&r1=313827&r2=313828&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/SemaCXX/ms-<wbr>interface.cpp (original)<br>
+++ cfe/trunk/test/SemaCXX/ms-<wbr>interface.cpp Wed Sep 20 15:28:24 2017<br>
@@ -77,3 +77,32 @@ class C1 : I6<C> {<br>
<br>
class C2 : I6<I> {<br>
};<br>
+<br>
+<br>
+// MSVC makes a special case in that an interface is allowed to have a data<br>
+// member if it is a property.<br>
+__interface HasProp {<br>
+ __declspec(property(get = Get, put = Put)) int data;<br>
+ int Get(void);<br>
+ void Put(int);<br>
+};<br>
+<br>
+struct __declspec(uuid("00000000-<wbr>0000-0000-C000-000000000046"))<br>
+ IUnknown {<br>
+ void foo();<br>
+ __declspec(property(get = Get, put = Put), deprecated) int data;<br>
+ int Get(void);<br>
+ void Put(int);<br>
+};<br>
+<br>
+struct IFaceStruct : IUnknown {<br>
+ __declspec(property(get = Get2, put = Put2), deprecated) int data2;<br>
+ int Get2(void);<br>
+ void Put2(int);<br>
+};<br>
+<br>
+__interface IFaceInheritsStruct : IFaceStruct {};<br>
+static_assert(!__is_<wbr>interface_class(HasProp), "oops");<br>
+static_assert(!__is_<wbr>interface_class(IUnknown), "oops");<br>
+static_assert(!__is_<wbr>interface_class(IFaceStruct), "oops");<br>
+static_assert(!__is_<wbr>interface_class(<wbr>IFaceInheritsStruct), "oops");<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div>