<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">On 30 Dec 2016 3:06 pm, "Simon Pilgrim via cfe-commits" <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rksimon<br>
Date: Fri Dec 30 16:55:33 2016<br>
New Revision: 290773<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=290773&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=290773&view=rev</a><br>
Log:<br>
Wdocumentation fix<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Thanks, but please be careful you don't introduce trailing whitespace changes to unrelated code in the future.</div><div dir="auto"><br></div><div dir="auto">Also perhaps we should turn this warning on by default for regular selfhosted builds so we don't need to wait for a buildbot to find issues like this?</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Modified:<br>
cfe/trunk/lib/Sema/<wbr>SemaTemplate.cpp<br>
<br>
Modified: cfe/trunk/lib/Sema/<wbr>SemaTemplate.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=290773&r1=290772&r2=290773&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Sema/<wbr>SemaTemplate.cpp?rev=290773&<wbr>r1=290772&r2=290773&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Sema/<wbr>SemaTemplate.cpp (original)<br>
+++ cfe/trunk/lib/Sema/<wbr>SemaTemplate.cpp Fri Dec 30 16:55:33 2016<br>
@@ -88,14 +88,14 @@ static NamedDecl *isAcceptableTemplateNa<br>
return nullptr;<br>
}<br>
<br>
-void Sema::<wbr>FilterAcceptableTemplateNames(<wbr>LookupResult &R,<br>
+void Sema::<wbr>FilterAcceptableTemplateNames(<wbr>LookupResult &R,<br>
bool AllowFunctionTemplates) {<br>
// The set of class templates we've already seen.<br>
llvm::SmallPtrSet<<wbr>ClassTemplateDecl *, 8> ClassTemplates;<br>
LookupResult::Filter filter = R.makeFilter();<br>
while (filter.hasNext()) {<br>
NamedDecl *Orig = filter.next();<br>
- NamedDecl *Repl = isAcceptableTemplateName(<wbr>Context, Orig,<br>
+ NamedDecl *Repl = isAcceptableTemplateName(<wbr>Context, Orig,<br>
AllowFunctionTemplates);<br>
if (!Repl)<br>
filter.erase();<br>
@@ -131,7 +131,7 @@ bool Sema::<wbr>hasAnyAcceptableTemplateNames<br>
for (LookupResult::iterator I = R.begin(), IEnd = R.end(); I != IEnd; ++I)<br>
if (isAcceptableTemplateName(<wbr>Context, *I, AllowFunctionTemplates))<br>
return true;<br>
-<br>
+<br>
return false;<br>
}<br>
<br>
@@ -265,7 +265,7 @@ void Sema::LookupTemplateName(<wbr>LookupResu<br>
assert((isDependent || !ObjectType->isIncompleteType(<wbr>) ||<br>
ObjectType->castAs<TagType>()-<wbr>>isBeingDefined()) &&<br>
"Caller should have completed object type");<br>
-<br>
+<br>
// Template names cannot appear inside an Objective-C class or object type.<br>
if (ObjectType-><wbr>isObjCObjectOrInterfaceType()) {<br>
Found.clear();<br>
@@ -312,7 +312,7 @@ void Sema::LookupTemplateName(<wbr>LookupResu<br>
} else {<br>
// Perform unqualified name lookup in the current scope.<br>
LookupName(Found, S);<br>
-<br>
+<br>
if (!ObjectType.isNull())<br>
AllowFunctionTemplatesInLookup = false;<br>
}<br>
@@ -890,7 +890,7 @@ Decl *Sema::<wbr>ActOnTemplateTemplateParamet<br>
Depth, Position, IsParameterPack,<br>
Name, Params);<br>
Param->setAccess(AS_public);<br>
-<br>
+<br>
// If the template template parameter has a name, then link the identifier<br>
// into the scope and lookup mechanisms.<br>
if (Name) {<br>
@@ -1020,8 +1020,8 @@ Sema::CheckClassTemplate(Scope *S, unsig<br>
if (RequireCompleteDeclContext(<wbr>SS, SemanticContext))<br>
return true;<br>
<br>
- // If we're adding a template to a dependent context, we may need to<br>
- // rebuilding some of the types used within the template parameter list,<br>
+ // If we're adding a template to a dependent context, we may need to<br>
+ // rebuilding some of the types used within the template parameter list,<br>
// now that we know what the current instantiation is.<br>
if (SemanticContext-><wbr>isDependentContext()) {<br>
ContextRAII SavedContext(*this, SemanticContext);<br>
@@ -1247,10 +1247,10 @@ Sema::CheckClassTemplate(Scope *S, unsig<br>
DeclarationName(Name), TemplateParams,<br>
NewClass, PrevClassTemplate);<br>
NewClass-><wbr>setDescribedClassTemplate(<wbr>NewTemplate);<br>
-<br>
+<br>
if (ModulePrivateLoc.isValid())<br>
NewTemplate->setModulePrivate(<wbr>);<br>
-<br>
+<br>
// Build the type for the class template declaration now.<br>
QualType T = NewTemplate-><wbr>getInjectedClassNameSpecializa<wbr>tion();<br>
T = Context.<wbr>getInjectedClassNameType(<wbr>NewClass, T);<br>
@@ -1341,7 +1341,7 @@ static bool DiagnoseDefaultTemplateArgum<br>
// A default template-argument shall not be specified in a<br>
// function template declaration or a function template<br>
// definition [...]<br>
- // If a friend function template declaration specifies a default<br>
+ // If a friend function template declaration specifies a default<br>
// template-argument, that declaration shall be a definition and shall be<br>
// the only declaration of the function template in the translation unit.<br>
// (C++98/03 doesn't have this wording; see DR226).<br>
@@ -1768,10 +1768,10 @@ static SourceRange getRangeOfTypeInNeste<br>
return NNSLoc.getTypeLoc().<wbr>getSourceRange();<br>
} else<br>
break;<br>
-<br>
+<br>
NNSLoc = NNSLoc.getPrefix();<br>
}<br>
-<br>
+<br>
return SourceRange();<br>
}<br>
<br>
@@ -1814,34 +1814,34 @@ TemplateParameterList *Sema::MatchTempla<br>
bool &IsExplicitSpecialization, bool &Invalid) {<br>
IsExplicitSpecialization = false;<br>
Invalid = false;<br>
-<br>
+<br>
// The sequence of nested types to which we will match up the template<br>
// parameter lists. We first build this list by starting with the type named<br>
// by the nested-name-specifier and walking out until we run out of types.<br>
SmallVector<QualType, 4> NestedTypes;<br>
QualType T;<br>
if (SS.getScopeRep()) {<br>
- if (CXXRecordDecl *Record<br>
+ if (CXXRecordDecl *Record<br>
= dyn_cast_or_null<<wbr>CXXRecordDecl>(<wbr>computeDeclContext(SS, true)))<br>
T = Context.getTypeDeclType(<wbr>Record);<br>
else<br>
T = QualType(SS.getScopeRep()-><wbr>getAsType(), 0);<br>
}<br>
-<br>
+<br>
// If we found an explicit specialization that prevents us from needing<br>
// 'template<>' headers, this will be set to the location of that<br>
// explicit specialization.<br>
SourceLocation ExplicitSpecLoc;<br>
-<br>
+<br>
while (!T.isNull()) {<br>
NestedTypes.push_back(T);<br>
-<br>
+<br>
// Retrieve the parent of a record type.<br>
if (CXXRecordDecl *Record = T->getAsCXXRecordDecl()) {<br>
// If this type is an explicit specialization, we're done.<br>
if (<wbr>ClassTemplateSpecializationDec<wbr>l *Spec<br>
= dyn_cast<<wbr>ClassTemplateSpecializationDec<wbr>l>(Record)) {<br>
- if (!isa<<wbr>ClassTemplatePartialSpecializa<wbr>tionDecl>(Spec) &&<br>
+ if (!isa<<wbr>ClassTemplatePartialSpecializa<wbr>tionDecl>(Spec) &&<br>
Spec->getSpecializationKind() == TSK_ExplicitSpecialization) {<br>
ExplicitSpecLoc = Spec->getLocation();<br>
break;<br>
@@ -1851,14 +1851,14 @@ TemplateParameterList *Sema::MatchTempla<br>
ExplicitSpecLoc = Record->getLocation();<br>
break;<br>
}<br>
-<br>
+<br>
if (TypeDecl *Parent = dyn_cast<TypeDecl>(Record-><wbr>getParent()))<br>
T = Context.getTypeDeclType(<wbr>Parent);<br>
else<br>
T = QualType();<br>
continue;<br>
- }<br>
-<br>
+ }<br>
+<br>
if (const TemplateSpecializationType *TST<br>
= T->getAs<<wbr>TemplateSpecializationType>()) {<br>
if (TemplateDecl *Template = TST->getTemplateName().<wbr>getAsTemplateDecl()) {<br>
@@ -1866,10 +1866,10 @@ TemplateParameterList *Sema::MatchTempla<br>
T = Context.getTypeDeclType(<wbr>Parent);<br>
else<br>
T = QualType();<br>
- continue;<br>
+ continue;<br>
}<br>
}<br>
-<br>
+<br>
// Look one step prior in a dependent template specialization type.<br>
if (const DependentTemplateSpecializatio<wbr>nType *DependentTST<br>
= T->getAs<<wbr>DependentTemplateSpecializatio<wbr>nType>()) {<br>
@@ -1879,7 +1879,7 @@ TemplateParameterList *Sema::MatchTempla<br>
T = QualType();<br>
continue;<br>
}<br>
-<br>
+<br>
// Look one step prior in a dependent name type.<br>
if (const DependentNameType *DependentName = T->getAs<DependentNameType>())<wbr>{<br>
if (NestedNameSpecifier *NNS = DependentName->getQualifier())<br>
@@ -1888,18 +1888,18 @@ TemplateParameterList *Sema::MatchTempla<br>
T = QualType();<br>
continue;<br>
}<br>
-<br>
+<br>
// Retrieve the parent of an enumeration type.<br>
if (const EnumType *EnumT = T->getAs<EnumType>()) {<br>
// FIXME: Forward-declared enums require a TSK_ExplicitSpecialization<br>
// check here.<br>
EnumDecl *Enum = EnumT->getDecl();<br>
-<br>
+<br>
// Get to the parent type.<br>
if (TypeDecl *Parent = dyn_cast<TypeDecl>(Enum-><wbr>getParent()))<br>
T = Context.getTypeDeclType(<wbr>Parent);<br>
else<br>
- T = QualType();<br>
+ T = QualType();<br>
continue;<br>
}<br>
<br>
@@ -1951,21 +1951,21 @@ TemplateParameterList *Sema::MatchTempla<br>
for (unsigned TypeIdx = 0, NumTypes = NestedTypes.size(); TypeIdx != NumTypes;<br>
++TypeIdx) {<br>
T = NestedTypes[TypeIdx];<br>
-<br>
+<br>
// Whether we expect a 'template<>' header.<br>
bool NeedEmptyTemplateHeader = false;<br>
<br>
// Whether we expect a template header with parameters.<br>
bool NeedNonemptyTemplateHeader = false;<br>
-<br>
+<br>
// For a dependent type, the set of template parameters that we<br>
// expect to see.<br>
TemplateParameterList *ExpectedTemplateParams = nullptr;<br>
<br>
// C++0x [temp.expl.spec]p15:<br>
- // A member or a member template may be nested within many enclosing<br>
- // class templates. In an explicit specialization for such a member, the<br>
- // member declaration shall be preceded by a template<> for each<br>
+ // A member or a member template may be nested within many enclosing<br>
+ // class templates. In an explicit specialization for such a member, the<br>
+ // member declaration shall be preceded by a template<> for each<br>
// enclosing class template that is explicitly specialized.<br>
if (CXXRecordDecl *Record = T->getAsCXXRecordDecl()) {<br>
if (<wbr>ClassTemplatePartialSpecializa<wbr>tionDecl *Partial<br>
@@ -1982,38 +1982,38 @@ TemplateParameterList *Sema::MatchTempla<br>
= dyn_cast<<wbr>ClassTemplateSpecializationDec<wbr>l>(Record)) {<br>
// C++0x [temp.expl.spec]p4:<br>
// Members of an explicitly specialized class template are defined<br>
- // in the same manner as members of normal classes, and not using<br>
- // the template<> syntax.<br>
+ // in the same manner as members of normal classes, and not using<br>
+ // the template<> syntax.<br>
if (Spec->getSpecializationKind() != TSK_ExplicitSpecialization)<br>
NeedEmptyTemplateHeader = true;<br>
else<br>
continue;<br>
} else if (Record-><wbr>getTemplateSpecializationKind(<wbr>)) {<br>
- if (Record-><wbr>getTemplateSpecializationKind(<wbr>)<br>
+ if (Record-><wbr>getTemplateSpecializationKind(<wbr>)<br>
!= TSK_ExplicitSpecialization &&<br>
TypeIdx == NumTypes - 1)<br>
IsExplicitSpecialization = true;<br>
-<br>
+<br>
continue;<br>
}<br>
} else if (const TemplateSpecializationType *TST<br>
= T->getAs<<wbr>TemplateSpecializationType>()) {<br>
if (TemplateDecl *Template = TST->getTemplateName().<wbr>getAsTemplateDecl()) {<br>
ExpectedTemplateParams = Template-><wbr>getTemplateParameters();<br>
- NeedNonemptyTemplateHeader = true;<br>
+ NeedNonemptyTemplateHeader = true;<br>
}<br>
} else if (T->getAs<<wbr>DependentTemplateSpecializatio<wbr>nType>()) {<br>
// FIXME: We actually could/should check the template arguments here<br>
// against the corresponding template parameter list.<br>
NeedNonemptyTemplateHeader = false;<br>
- }<br>
-<br>
+ }<br>
+<br>
// C++ [temp.expl.spec]p16:<br>
- // In an explicit specialization declaration for a member of a class<br>
- // template or a member template that ap- pears in namespace scope, the<br>
- // member template and some of its enclosing class templates may remain<br>
- // unspecialized, except that the declaration shall not explicitly<br>
- // specialize a class member template if its en- closing class templates<br>
+ // In an explicit specialization declaration for a member of a class<br>
+ // template or a member template that ap- pears in namespace scope, the<br>
+ // member template and some of its enclosing class templates may remain<br>
+ // unspecialized, except that the declaration shall not explicitly<br>
+ // specialize a class member template if its en- closing class templates<br>
// are not explicitly specialized as well.<br>
if (ParamIdx < ParamLists.size()) {<br>
if (ParamLists[ParamIdx]->size() == 0) {<br>
@@ -2023,7 +2023,7 @@ TemplateParameterList *Sema::MatchTempla<br>
} else<br>
SawNonEmptyTemplateParameterLi<wbr>st = true;<br>
}<br>
-<br>
+<br>
if (NeedEmptyTemplateHeader) {<br>
// If we're on the last of the types, and we need a 'template<>' header<br>
// here, then it's an explicit specialization.<br>
@@ -2033,7 +2033,7 @@ TemplateParameterList *Sema::MatchTempla<br>
if (ParamIdx < ParamLists.size()) {<br>
if (ParamLists[ParamIdx]->size() > 0) {<br>
// The header has template parameters when it shouldn't. Complain.<br>
- Diag(ParamLists[ParamIdx]-><wbr>getTemplateLoc(),<br>
+ Diag(ParamLists[ParamIdx]-><wbr>getTemplateLoc(),<br>
diag::err_template_param_list_<wbr>matches_nontemplate)<br>
<< T<br>
<< SourceRange(ParamLists[<wbr>ParamIdx]->getLAngleLoc(),<br>
@@ -2065,7 +2065,7 @@ TemplateParameterList *Sema::MatchTempla<br>
if (ParamIdx < ParamLists.size() &&<br>
DependsOnTemplateParameters(T, ParamLists[ParamIdx]))<br>
ExpectedTemplateParams = nullptr;<br>
- else<br>
+ else<br>
continue;<br>
}<br>
<br>
@@ -2081,11 +2081,11 @@ TemplateParameterList *Sema::MatchTempla<br>
CheckTemplateParameterList(<wbr>ParamLists[ParamIdx], nullptr,<br>
TPC_ClassTemplateMember))<br>
Invalid = true;<br>
-<br>
+<br>
++ParamIdx;<br>
continue;<br>
}<br>
-<br>
+<br>
Diag(DeclLoc, diag::err_template_spec_needs_<wbr>template_parameters)<br>
<< T<br>
<< getRangeOfTypeInNestedNameSpec<wbr>ifier(Context, T, SS);<br>
@@ -2135,10 +2135,10 @@ TemplateParameterList *Sema::MatchTempla<br>
// not required, and there were any 'template<>' headers, note where the<br>
// specialization occurred.<br>
if (ExplicitSpecLoc.isValid() && HasAnyExplicitSpecHeader)<br>
- Diag(ExplicitSpecLoc,<br>
+ Diag(ExplicitSpecLoc,<br>
diag::note_explicit_template_<wbr>spec_does_not_need_header)<br>
<< NestedTypes.back();<br>
-<br>
+<br>
// We have a template parameter list with no corresponding scope, which<br>
// means that the resulting template declaration can't be instantiated<br>
// properly (we'll end up with dependent nodes when we shouldn't).<br>
@@ -2147,11 +2147,11 @@ TemplateParameterList *Sema::MatchTempla<br>
}<br>
<br>
// C++ [temp.expl.spec]p16:<br>
- // In an explicit specialization declaration for a member of a class<br>
- // template or a member template that ap- pears in namespace scope, the<br>
- // member template and some of its enclosing class templates may remain<br>
- // unspecialized, except that the declaration shall not explicitly<br>
- // specialize a class member template if its en- closing class templates<br>
+ // In an explicit specialization declaration for a member of a class<br>
+ // template or a member template that ap- pears in namespace scope, the<br>
+ // member template and some of its enclosing class templates may remain<br>
+ // unspecialized, except that the declaration shall not explicitly<br>
+ // specialize a class member template if its en- closing class templates<br>
// are not explicitly specialized as well.<br>
if (ParamLists.back()->size() == 0 &&<br>
CheckExplicitSpecialization(<wbr>ParamLists[ParamIdx]-><wbr>getSourceRange(),<br>
@@ -2176,14 +2176,14 @@ void Sema::NoteAllFoundTemplates(<wbr>Templat<br>
<< Template->getDeclName();<br>
return;<br>
}<br>
-<br>
+<br>
if (OverloadedTemplateStorage *OST = Name.getAsOverloadedTemplate()<wbr>) {<br>
- for (OverloadedTemplateStorage::<wbr>iterator I = OST->begin(),<br>
+ for (OverloadedTemplateStorage::<wbr>iterator I = OST->begin(),<br>
IEnd = OST->end();<br>
I != IEnd; ++I)<br>
Diag((*I)->getLocation(), diag::note_template_declared_<wbr>here)<br>
<< 0 << (*I)->getDeclName();<br>
-<br>
+<br>
return;<br>
}<br>
}<br>
@@ -2459,7 +2459,7 @@ Sema::ActOnTemplateIdType(<wbr>CXXScopeSpec &<br>
SpecTL.setArgLocInfo(I, TemplateArgs[I].getLocInfo());<br>
return CreateParsedType(T, TLB.getTypeSourceInfo(Context, T));<br>
}<br>
-<br>
+<br>
QualType Result = CheckTemplateIdType(Template, TemplateLoc, TemplateArgs);<br>
<br>
if (Result.isNull())<br>
@@ -2486,7 +2486,7 @@ Sema::ActOnTemplateIdType(<wbr>CXXScopeSpec &<br>
ElabTL.<wbr>setElaboratedKeywordLoc(<wbr>SourceLocation());<br>
ElabTL.setQualifierLoc(SS.<wbr>getWithLocInContext(Context));<br>
}<br>
-<br>
+<br>
return CreateParsedType(Result, TLB.getTypeSourceInfo(Context, Result));<br>
}<br>
<br>
@@ -2501,11 +2501,11 @@ TypeResult Sema::ActOnTagTemplateIdType(<br>
ASTTemplateArgsPtr TemplateArgsIn,<br>
SourceLocation RAngleLoc) {<br>
TemplateName Template = TemplateD.get();<br>
-<br>
+<br>
// Translate the parser's template argument list in our AST format.<br>
TemplateArgumentListInfo TemplateArgs(LAngleLoc, RAngleLoc);<br>
translateTemplateArguments(<wbr>TemplateArgsIn, TemplateArgs);<br>
-<br>
+<br>
// Determine the tag kind<br>
TagTypeKind TagKind = TypeWithKeyword::<wbr>getTagTypeKindForTypeSpec(<wbr>TagSpec);<br>
ElaboratedTypeKeyword Keyword<br>
@@ -2513,11 +2513,11 @@ TypeResult Sema::ActOnTagTemplateIdType(<br>
<br>
if (DependentTemplateName *DTN = Template.<wbr>getAsDependentTemplateName()) {<br>
QualType T = Context.<wbr>getDependentTemplateSpecializa<wbr>tionType(Keyword,<br>
- DTN->getQualifier(),<br>
- DTN->getIdentifier(),<br>
+ DTN->getQualifier(),<br>
+ DTN->getIdentifier(),<br>
TemplateArgs);<br>
-<br>
- // Build type-source information.<br>
+<br>
+ // Build type-source information.<br>
TypeLocBuilder TLB;<br>
DependentTemplateSpecializatio<wbr>nTypeLoc SpecTL<br>
= TLB.push<<wbr>DependentTemplateSpecializatio<wbr>nTypeLoc>(T);<br>
@@ -2542,18 +2542,18 @@ TypeResult Sema::ActOnTagTemplateIdType(<br>
<< TAT << NTK_TypeAliasTemplate << TagKind;<br>
Diag(TAT->getLocation(), diag::note_declared_at);<br>
}<br>
-<br>
+<br>
QualType Result = CheckTemplateIdType(Template, TemplateLoc, TemplateArgs);<br>
if (Result.isNull())<br>
return TypeResult(true);<br>
-<br>
+<br>
// Check the tag kind<br>
if (const RecordType *RT = Result->getAs<RecordType>()) {<br>
RecordDecl *D = RT->getDecl();<br>
-<br>
+<br>
IdentifierInfo *Id = D->getIdentifier();<br>
assert(Id && "templated class must have an identifier");<br>
-<br>
+<br>
if (!<wbr>isAcceptableTagRedeclaration(<wbr>D, TagKind, TUK == TUK_Definition,<br>
TagLoc, Id)) {<br>
Diag(TagLoc, diag::err_use_with_wrong_tag)<br>
@@ -3409,7 +3409,7 @@ bool Sema::<wbr>CheckTemplateTypeArgument(Tem<br>
<br>
// Add the converted template type argument.<br>
ArgType = Context.getCanonicalType(<wbr>ArgType);<br>
-<br>
+<br>
// Objective-C ARC:<br>
// If an explicitly-specified template argument type is a lifetime type<br>
// with no lifetime qualifier, the __strong lifetime qualifier is inferred.<br>
@@ -3420,7 +3420,7 @@ bool Sema::<wbr>CheckTemplateTypeArgument(Tem<br>
Qs.setObjCLifetime(Qualifiers:<wbr>:OCL_Strong);<br>
ArgType = Context.getQualifiedType(<wbr>ArgType, Qs);<br>
}<br>
-<br>
+<br>
Converted.push_back(<wbr>TemplateArgument(ArgType));<br>
return false;<br>
}<br>
@@ -3550,7 +3550,7 @@ SubstDefaultTemplateArgument(<wbr>Sema &SemaR<br>
/// \param Converted the list of template arguments provided for template<br>
/// parameters that precede \p Param in the template parameter list.<br>
///<br>
-/// \param QualifierLoc Will be set to the nested-name-specifier (with<br>
+/// \param QualifierLoc Will be set to the nested-name-specifier (with<br>
/// source-location information) that precedes the template name.<br>
///<br>
/// \returns the substituted template argument, or NULL if an error occurred.<br>
@@ -3901,7 +3901,7 @@ bool Sema::CheckTemplateArgument(<wbr>NamedDe<br>
return false;<br>
}<br>
<br>
-/// \brief Diagnose an arity mismatch in the<br>
+/// \brief Diagnose an arity mismatch in the<br>
static bool diagnoseArityMismatch(Sema &S, TemplateDecl *Template,<br>
SourceLocation TemplateLoc,<br>
TemplateArgumentListInfo &TemplateArgs) {<br>
@@ -3911,7 +3911,7 @@ static bool diagnoseArityMismatch(Sema &<br>
<br>
SourceRange Range;<br>
if (NumArgs > NumParams)<br>
- Range = SourceRange(TemplateArgs[<wbr>NumParams].getLocation(),<br>
+ Range = SourceRange(TemplateArgs[<wbr>NumParams].getLocation(),<br>
TemplateArgs.getRAngleLoc());<br>
S.Diag(TemplateLoc, diag::err_template_arg_list_<wbr>different_arity)<br>
<< (NumArgs > NumParams)<br>
@@ -4535,20 +4535,20 @@ isNullPointerValueTemplateArgu<wbr>ment(Sema<br>
<br>
if (!S.getLangOpts().CPlusPlus11)<br>
return NPV_NotNullPointer;<br>
-<br>
+<br>
// Determine whether we have a constant expression.<br>
ExprResult ArgRV = S.<wbr>DefaultFunctionArrayConversion<wbr>(Arg);<br>
if (ArgRV.isInvalid())<br>
return NPV_Error;<br>
Arg = ArgRV.get();<br>
-<br>
+<br>
Expr::EvalResult EvalResult;<br>
SmallVector<<wbr>PartialDiagnosticAt, 8> Notes;<br>
EvalResult.Diag = &Notes;<br>
if (!Arg->EvaluateAsRValue(<wbr>EvalResult, S.Context) ||<br>
EvalResult.HasSideEffects) {<br>
SourceLocation DiagLoc = Arg->getExprLoc();<br>
-<br>
+<br>
// If our only note is the usual "invalid subexpression" note, just point<br>
// the caret at its location rather than producing an essentially<br>
// redundant note.<br>
@@ -4557,21 +4557,21 @@ isNullPointerValueTemplateArgu<wbr>ment(Sema<br>
DiagLoc = Notes[0].first;<br>
Notes.clear();<br>
}<br>
-<br>
+<br>
S.Diag(DiagLoc, diag::err_template_arg_not_<wbr>address_constant)<br>
<< Arg->getType() << Arg->getSourceRange();<br>
for (unsigned I = 0, N = Notes.size(); I != N; ++I)<br>
S.Diag(Notes[I].first, Notes[I].second);<br>
-<br>
+<br>
S.Diag(Param->getLocation(), diag::note_template_param_<wbr>here);<br>
return NPV_Error;<br>
}<br>
-<br>
+<br>
// C++11 [temp.arg.nontype]p1:<br>
// - an address constant expression of type std::nullptr_t<br>
if (Arg->getType()-><wbr>isNullPtrType())<br>
return NPV_NullPointer;<br>
-<br>
+<br>
// - a constant expression that evaluates to a null pointer value (4.10); or<br>
// - a constant expression that evaluates to a null member pointer value<br>
// (4.11); or<br>
@@ -4584,7 +4584,7 @@ isNullPointerValueTemplateArgu<wbr>ment(Sema<br>
S.IsQualificationConversion(<wbr>Arg->getType(), ParamType, false,<br>
ObjCLifetimeConversion))<br>
return NPV_NullPointer;<br>
-<br>
+<br>
// The types didn't match, but we know we got a null pointer; complain,<br>
// then recover as if the types were correct.<br>
S.Diag(Arg->getExprLoc(), diag::err_template_arg_<wbr>wrongtype_null_constant)<br>
@@ -4604,7 +4604,7 @@ isNullPointerValueTemplateArgu<wbr>ment(Sema<br>
S.Diag(Param->getLocation(), diag::note_template_param_<wbr>here);<br>
return NPV_NullPointer;<br>
}<br>
-<br>
+<br>
// FIXME: If we ever want to support general, address-constant expressions<br>
// as non-type template arguments, we should return the ExprResult here to<br>
// be interpreted by the caller.<br>
@@ -5347,7 +5347,7 @@ ExprResult Sema::CheckTemplateArgument(N<br>
} else if (!Arg->isValueDependent()) {<br>
class TmplArgICEDiagnoser : public VerifyICEDiagnoser {<br>
QualType T;<br>
-<br>
+<br>
public:<br>
TmplArgICEDiagnoser(QualType T) : T(T) { }<br>
<br>
@@ -5409,14 +5409,14 @@ ExprResult Sema::CheckTemplateArgument(N<br>
Value.setIsSigned(IntegerType-<wbr>><wbr>isSignedIntegerOrEnumerationTy<wbr>pe());<br>
} else {<br>
llvm::APSInt OldValue = Value;<br>
-<br>
+<br>
// Coerce the template argument's value to the value it will have<br>
// based on the template parameter's type.<br>
unsigned AllowedBits = Context.getTypeSize(<wbr>IntegerType);<br>
if (Value.getBitWidth() != AllowedBits)<br>
Value = Value.extOrTrunc(AllowedBits);<br>
Value.setIsSigned(IntegerType-<wbr>><wbr>isSignedIntegerOrEnumerationTy<wbr>pe());<br>
-<br>
+<br>
// Complain if an unsigned parameter received a negative value.<br>
if (IntegerType-><wbr>isUnsignedIntegerOrEnumeration<wbr>Type()<br>
&& (OldValue.isSigned() && OldValue.isNegative())) {<br>
@@ -5425,7 +5425,7 @@ ExprResult Sema::CheckTemplateArgument(N<br>
<< Arg->getSourceRange();<br>
Diag(Param->getLocation(), diag::note_template_param_<wbr>here);<br>
}<br>
-<br>
+<br>
// Complain if we overflowed the template parameter's type.<br>
unsigned RequiredBits;<br>
if (IntegerType-><wbr>isUnsignedIntegerOrEnumeration<wbr>Type())<br>
@@ -5444,7 +5444,7 @@ ExprResult Sema::CheckTemplateArgument(N<br>
}<br>
<br>
Converted = TemplateArgument(Context, Value,<br>
- ParamType->isEnumeralType()<br>
+ ParamType->isEnumeralType()<br>
? Context.getCanonicalType(<wbr>ParamType)<br>
: IntegerType);<br>
return Arg;<br>
@@ -5556,17 +5556,17 @@ ExprResult Sema::CheckTemplateArgument(N<br>
Converted = TemplateArgument(Arg);<br>
return Arg;<br>
}<br>
-<br>
+<br>
switch (<wbr>isNullPointerValueTemplateArgu<wbr>ment(*this, Param, ParamType, Arg)) {<br>
case NPV_NotNullPointer:<br>
Diag(Arg->getExprLoc(), diag::err_template_arg_not_<wbr>convertible)<br>
<< Arg->getType() << ParamType;<br>
Diag(Param->getLocation(), diag::note_template_param_<wbr>here);<br>
return ExprError();<br>
-<br>
+<br>
case NPV_Error:<br>
return ExprError();<br>
-<br>
+<br>
case NPV_NullPointer:<br>
Diag(Arg->getExprLoc(), diag::warn_cxx98_compat_<wbr>template_arg_null);<br>
Converted = TemplateArgument(Context.<wbr>getCanonicalType(ParamType),<br>
@@ -5813,7 +5813,7 @@ Sema::<wbr>BuildExpressionFromIntegralTem<wbr>plat<br>
Context.<wbr>getTrivialTypeSourceInfo(<wbr>OrigT, Loc),<br>
Loc, Loc);<br>
}<br>
-<br>
+<br>
return E;<br>
}<br>
<br>
@@ -6194,7 +6194,7 @@ static bool CheckTemplateSpecializationS<br>
<< Specialized;<br>
return true;<br>
}<br>
-<br>
+<br>
// C++ [temp.class.spec]p6:<br>
// A class template partial specialization may be declared or redeclared<br>
// in any namespace scope in which its definition may be defined (14.5.1<br>
@@ -6384,7 +6384,7 @@ static bool CheckNonTypeTemplatePartialS<br>
/// partial specialization according to C++ [temp.class.spec]p9.<br>
///<br>
/// \param TemplateNameLoc the location of the template name.<br>
-/// \param TemplateParams the template parameters of the primary class<br>
+/// \param PrimaryTemplate the template parameters of the primary class<br>
/// template.<br>
/// \param NumExplicit the number of explicitly-specified template arguments.<br>
/// \param TemplateArgs the template arguments of the class template<br>
@@ -6746,7 +6746,7 @@ Sema::<wbr>ActOnClassTemplateSpecializati<wbr>on(S<br>
Diag(Specialization-><wbr>getLocation(), diag::err_module_private_<wbr>specialization)<br>
<< (isPartialSpecialization? 1 : 0)<br>
<< FixItHint::CreateRemoval(<wbr>ModulePrivateLoc);<br>
-<br>
+<br>
// Build the fully-sugared type for this class template<br>
// specialization as the user wrote in the specialization<br>
// itself. This means that we'll pretty-print the type retrieved<br>
@@ -7226,7 +7226,7 @@ bool Sema::<wbr>CheckFunctionTemplateSpeciali<br>
SpecInfo-><wbr>getPointOfInstantiation(),<br>
HasNoEffect))<br>
return true;<br>
-<br>
+<br>
// Mark the prior declaration as an explicit specialization, so that later<br>
// clients know that this is an explicit specialization.<br>
if (!isFriend) {<br>
@@ -8015,18 +8015,18 @@ DeclResult Sema::ActOnExplicitInstantiat<br>
return true;<br>
<br>
// C++ [dcl.stc]p1:<br>
- // A storage-class-specifier shall not be specified in [...] an explicit<br>
+ // A storage-class-specifier shall not be specified in [...] an explicit<br>
// instantiation (14.7.2) directive.<br>
if (D.getDeclSpec().<wbr>getStorageClassSpec() == DeclSpec::SCS_typedef) {<br>
Diag(D.getIdentifierLoc(), diag::err_explicit_<wbr>instantiation_of_typedef)<br>
<< Name;<br>
return true;<br>
- } else if (D.getDeclSpec().<wbr>getStorageClassSpec()<br>
+ } else if (D.getDeclSpec().<wbr>getStorageClassSpec()<br>
!= DeclSpec::SCS_unspecified) {<br>
// Complain about then remove the storage class specifier.<br>
Diag(D.getIdentifierLoc(), diag::err_explicit_<wbr>instantiation_storage_class)<br>
<< FixItHint::CreateRemoval(D.<wbr>getDeclSpec().<wbr>getStorageClassSpecLoc());<br>
-<br>
+<br>
D.getMutableDeclSpec().<wbr>ClearStorageClassSpecs();<br>
}<br>
<br>
@@ -8408,7 +8408,7 @@ Sema::ActOnDependentTag(Scope *S, unsign<br>
// Create the resulting type.<br>
ElaboratedTypeKeyword Kwd = TypeWithKeyword::<wbr>getKeywordForTagTypeKind(Kind)<wbr>;<br>
QualType Result = Context.getDependentNameType(<wbr>Kwd, NNS, Name);<br>
-<br>
+<br>
// Create type-source location information for this type.<br>
TypeLocBuilder TLB;<br>
DependentNameTypeLoc TL = TLB.push<DependentNameTypeLoc><wbr>(Result);<br>
@@ -8424,7 +8424,7 @@ Sema::ActOnTypenameType(Scope *S, Source<br>
SourceLocation IdLoc) {<br>
if (SS.isInvalid())<br>
return true;<br>
-<br>
+<br>
if (TypenameLoc.isValid() && S && !S->getTemplateParamParent())<br>
Diag(TypenameLoc,<br>
getLangOpts().CPlusPlus11 ?<br>
@@ -8470,11 +8470,11 @@ Sema::ActOnTypenameType(Scope *S,<br>
diag::warn_cxx98_compat_<wbr>typename_outside_of_template :<br>
diag::ext_typename_outside_of_<wbr>template)<br>
<< FixItHint::CreateRemoval(<wbr>TypenameLoc);<br>
-<br>
+<br>
// Translate the parser's template argument list in our AST format.<br>
TemplateArgumentListInfo TemplateArgs(LAngleLoc, RAngleLoc);<br>
translateTemplateArguments(<wbr>TemplateArgsIn, TemplateArgs);<br>
-<br>
+<br>
TemplateName Template = TemplateIn.get();<br>
if (DependentTemplateName *DTN = Template.<wbr>getAsDependentTemplateName()) {<br>
// Construct a dependent template specialization type.<br>
@@ -8484,10 +8484,10 @@ Sema::ActOnTypenameType(Scope *S,<br>
DTN->getQualifier(),<br>
DTN->getIdentifier(),<br>
TemplateArgs);<br>
-<br>
+<br>
// Create source-location information for this type.<br>
TypeLocBuilder Builder;<br>
- DependentTemplateSpecializatio<wbr>nTypeLoc SpecTL<br>
+ DependentTemplateSpecializatio<wbr>nTypeLoc SpecTL<br>
= Builder.push<<wbr>DependentTemplateSpecializatio<wbr>nTypeLoc>(T);<br>
SpecTL.<wbr>setElaboratedKeywordLoc(<wbr>TypenameLoc);<br>
SpecTL.setQualifierLoc(SS.<wbr>getWithLocInContext(Context));<br>
@@ -8499,11 +8499,11 @@ Sema::ActOnTypenameType(Scope *S,<br>
SpecTL.setArgLocInfo(I, TemplateArgs[I].getLocInfo());<br>
return CreateParsedType(T, Builder.getTypeSourceInfo(<wbr>Context, T));<br>
}<br>
-<br>
+<br>
QualType T = CheckTemplateIdType(Template, TemplateNameLoc, TemplateArgs);<br>
if (T.isNull())<br>
return true;<br>
-<br>
+<br>
// Provide source-location information for the template specialization type.<br>
TypeLocBuilder Builder;<br>
TemplateSpecializationTypeLoc SpecTL<br>
@@ -8514,12 +8514,12 @@ Sema::ActOnTypenameType(Scope *S,<br>
SpecTL.setRAngleLoc(RAngleLoc)<wbr>;<br>
for (unsigned I = 0, N = TemplateArgs.size(); I != N; ++I)<br>
SpecTL.setArgLocInfo(I, TemplateArgs[I].getLocInfo());<br>
-<br>
+<br>
T = Context.getElaboratedType(ETK_<wbr>Typename, SS.getScopeRep(), T);<br>
ElaboratedTypeLoc TL = Builder.push<<wbr>ElaboratedTypeLoc>(T);<br>
TL.setElaboratedKeywordLoc(<wbr>TypenameLoc);<br>
TL.setQualifierLoc(SS.<wbr>getWithLocInContext(Context));<br>
-<br>
+<br>
TypeSourceInfo *TSI = Builder.getTypeSourceInfo(<wbr>Context, T);<br>
return CreateParsedType(T, TSI);<br>
}<br>
@@ -8564,9 +8564,9 @@ static bool isEnableIf(NestedNameSpecifi<br>
/// \brief Build the type that describes a C++ typename specifier,<br>
/// e.g., "typename T::type".<br>
QualType<br>
-Sema::CheckTypenameType(<wbr>ElaboratedTypeKeyword Keyword,<br>
+Sema::CheckTypenameType(<wbr>ElaboratedTypeKeyword Keyword,<br>
SourceLocation KeywordLoc,<br>
- NestedNameSpecifierLoc QualifierLoc,<br>
+ NestedNameSpecifierLoc QualifierLoc,<br>
const IdentifierInfo &II,<br>
SourceLocation IILoc) {<br>
CXXScopeSpec SS;<br>
@@ -8577,8 +8577,8 @@ Sema::CheckTypenameType(<wbr>ElaboratedTypeKe<br>
// If the nested-name-specifier is dependent and couldn't be<br>
// resolved to a type, build a typename type.<br>
assert(QualifierLoc.<wbr>getNestedNameSpecifier()-><wbr>isDependent());<br>
- return Context.getDependentNameType(<wbr>Keyword,<br>
- QualifierLoc.<wbr>getNestedNameSpecifier(),<br>
+ return Context.getDependentNameType(<wbr>Keyword,<br>
+ QualifierLoc.<wbr>getNestedNameSpecifier(),<br>
&II);<br>
}<br>
<br>
@@ -8630,8 +8630,8 @@ Sema::CheckTypenameType(<wbr>ElaboratedTypeKe<br>
<br>
case LookupResult::<wbr>NotFoundInCurrentInstantiation<wbr>:<br>
// Okay, it's a member of an unknown instantiation.<br>
- return Context.getDependentNameType(<wbr>Keyword,<br>
- QualifierLoc.<wbr>getNestedNameSpecifier(),<br>
+ return Context.getDependentNameType(<wbr>Keyword,<br>
+ QualifierLoc.<wbr>getNestedNameSpecifier(),<br>
&II);<br>
<br>
case LookupResult::Found:<br>
@@ -8639,7 +8639,7 @@ Sema::CheckTypenameType(<wbr>ElaboratedTypeKe<br>
// We found a type. Build an ElaboratedType, since the<br>
// typename-specifier was just sugar.<br>
MarkAnyDeclReferenced(Type-><wbr>getLocation(), Type, /*OdrUse=*/false);<br>
- return Context.getElaboratedType(ETK_<wbr>Typename,<br>
+ return Context.getElaboratedType(ETK_<wbr>Typename,<br>
QualifierLoc.<wbr>getNestedNameSpecifier(),<br>
Context.getTypeDeclType(Type))<wbr>;<br>
}<br>
@@ -8706,7 +8706,7 @@ namespace {<br>
this->Loc = Loc;<br>
this->Entity = Entity;<br>
}<br>
-<br>
+<br>
ExprResult TransformLambdaExpr(LambdaExpr *E) {<br>
// Lambdas never need to be transformed.<br>
return E;<br>
@@ -8757,15 +8757,15 @@ ExprResult Sema::RebuildExprInCurrentIns<br>
}<br>
<br>
bool Sema::<wbr>RebuildNestedNameSpecifierInCu<wbr>rrentInstantiation(<wbr>CXXScopeSpec &SS) {<br>
- if (SS.isInvalid())<br>
+ if (SS.isInvalid())<br>
return true;<br>
<br>
NestedNameSpecifierLoc QualifierLoc = SS.getWithLocInContext(<wbr>Context);<br>
CurrentInstantiationRebuilder Rebuilder(*this, SS.getRange().getBegin(),<br>
DeclarationName());<br>
- NestedNameSpecifierLoc Rebuilt<br>
+ NestedNameSpecifierLoc Rebuilt<br>
= Rebuilder.<wbr>TransformNestedNameSpecifierLo<wbr>c(QualifierLoc);<br>
- if (!Rebuilt)<br>
+ if (!Rebuilt)<br>
return true;<br>
<br>
SS.Adopt(Rebuilt);<br>
@@ -8778,36 +8778,36 @@ bool Sema::<wbr>RebuildTemplateParamsInCurren<br>
TemplateParameterList *Params) {<br>
for (unsigned I = 0, N = Params->size(); I != N; ++I) {<br>
Decl *Param = Params->getParam(I);<br>
-<br>
+<br>
// There is nothing to rebuild in a type parameter.<br>
if (isa<TemplateTypeParmDecl>(<wbr>Param))<br>
continue;<br>
-<br>
+<br>
// Rebuild the template parameter list of a template template parameter.<br>
- if (TemplateTemplateParmDecl *TTP<br>
+ if (TemplateTemplateParmDecl *TTP<br>
= dyn_cast<<wbr>TemplateTemplateParmDecl>(<wbr>Param)) {<br>
if (<wbr>RebuildTemplateParamsInCurrent<wbr>Instantiation(<br>
TTP->getTemplateParameters()))<br>
return true;<br>
-<br>
+<br>
continue;<br>
}<br>
-<br>
+<br>
// Rebuild the type of a non-type template parameter.<br>
NonTypeTemplateParmDecl *NTTP = cast<NonTypeTemplateParmDecl>(<wbr>Param);<br>
- TypeSourceInfo *NewTSI<br>
- = RebuildTypeInCurrentInstantiat<wbr>ion(NTTP->getTypeSourceInfo(),<br>
- NTTP->getLocation(),<br>
+ TypeSourceInfo *NewTSI<br>
+ = RebuildTypeInCurrentInstantiat<wbr>ion(NTTP->getTypeSourceInfo(),<br>
+ NTTP->getLocation(),<br>
NTTP->getDeclName());<br>
if (!NewTSI)<br>
return true;<br>
-<br>
+<br>
if (NewTSI != NTTP->getTypeSourceInfo()) {<br>
NTTP->setTypeSourceInfo(<wbr>NewTSI);<br>
NTTP->setType(NewTSI->getType(<wbr>));<br>
}<br>
}<br>
-<br>
+<br>
return false;<br>
}<br>
<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><br></div></div></div>