Skip to content

Commit f94766e

Browse files
committed
[FOLD] cleanups
1 parent 56aeb93 commit f94766e

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

clang/lib/AST/ExprCXX.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,9 +1507,8 @@ CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr(
15071507
new (getTrailingObjects<NestedNameSpecifierLoc>())
15081508
NestedNameSpecifierLoc(QualifierLoc);
15091509

1510-
std::uninitialized_copy_n(UnqualifiedLookups.data(),
1511-
UnqualifiedLookups.size(),
1512-
getTrailingObjects<DeclAccessPair>());
1510+
std::uninitialized_copy(UnqualifiedLookups.begin(), UnqualifiedLookups.end(),
1511+
getTrailingObjects<DeclAccessPair>());
15131512

15141513
if (TemplateArgs) {
15151514
auto Deps = TemplateArgumentDependence::None;

clang/lib/Parse/ParseExprCXX.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier(
354354
TemplateTy Template;
355355
TemplateNameKind TNK = Actions.ActOnTemplateName(
356356
getCurScope(), SS, TemplateKWLoc, TemplateName, ObjectType,
357-
EnteringContext, Template, /*AllowInjectedClassName*/ true,
357+
EnteringContext, Template, /*AllowInjectedClassName=*/true,
358358
/*MayBeNNS=*/true);
359359
if (AnnotateTemplateIdToken(Template, TNK, SS, TemplateKWLoc,
360360
TemplateName, false))
@@ -407,6 +407,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier(
407407
: TemplateId->TemplateNameLoc;
408408
SS.SetInvalid(SourceRange(StartLoc, CCLoc));
409409
}
410+
410411
continue;
411412
}
412413

@@ -540,7 +541,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier(
540541
// error recovery. But before we commit to this, check that we actually
541542
// have something that looks like a template-argument-list next.
542543
if (!IsTypename && (ObjectType || TNK == TNK_Undeclared_template) &&
543-
isTemplateArgumentList(1) == TPResult::False)
544+
isTemplateArgumentList(1) == TPResult::False)
544545
break;
545546

546547
// We have found a template name, so annotate this token
@@ -652,10 +653,10 @@ ExprResult Parser::tryParseCXXIdExpression(CXXScopeSpec &SS,
652653
if (isAddressOfOperand && isPostfixExpressionSuffixStart())
653654
isAddressOfOperand = false;
654655

655-
E = Actions.ActOnIdExpression(
656-
getCurScope(), SS, TemplateKWLoc, Name, Tok.is(tok::l_paren),
657-
isAddressOfOperand, /*CCC=*/nullptr, /*IsInlineAsmIdentifier=*/false,
658-
Replacement);
656+
E = Actions.ActOnIdExpression(getCurScope(), SS, TemplateKWLoc, Name,
657+
Tok.is(tok::l_paren), isAddressOfOperand,
658+
/*CCC=*/nullptr,
659+
/*IsInlineAsmIdentifier=*/false, Replacement);
659660
break;
660661
}
661662

@@ -1917,7 +1918,7 @@ Parser::ParseCXXPseudoDestructor(Expr *Base, SourceLocation OpLoc,
19171918
// argument list. This affects examples such as
19181919
// void f(auto *p) { p->~X<int>(); }
19191920
// ... but there's no ambiguity, and nowhere to write 'template' in such an
1920-
// example, so we accept it anyway
1921+
// example, so we accept it anyway.
19211922
if (Tok.is(tok::less) && ParseUnqualifiedIdTemplateId(
19221923
SS, ObjectType, Base && Base->containsErrors(),
19231924
/*TemplateKWLoc=*/SourceLocation(), TildeLoc,

clang/lib/Sema/SemaExprMember.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,9 +1753,8 @@ ExprResult Sema::ActOnMemberAccessExpr(Scope *S, Expr *Base,
17531753
// Decompose the name into its component parts.
17541754
DeclarationNameInfo NameInfo;
17551755
const TemplateArgumentListInfo *TemplateArgs;
1756-
DecomposeUnqualifiedId(Id, TemplateArgsBuffer,
1757-
NameInfo, TemplateArgs);
1758-
bool IsArrow = OpKind == tok::arrow;
1756+
DecomposeUnqualifiedId(Id, TemplateArgsBuffer, NameInfo, TemplateArgs);
1757+
bool IsArrow = (OpKind == tok::arrow);
17591758

17601759
if (getLangOpts().HLSL && IsArrow)
17611760
return ExprError(Diag(OpLoc, diag::err_hlsl_operator_unsupported) << 2);

clang/lib/Sema/SemaTemplate.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ Sema::isTemplateName(Scope *S, CXXScopeSpec &SS, bool hasTemplateKeyword,
212212
&AssumedTemplate,
213213
/*AllowTypoCorrection=*/!Disambiguation, MayBeNNS))
214214
return TNK_Non_template;
215-
216215
MemberOfUnknownSpecialization = R.wasNotFoundInCurrentInstantiation();
217216

218217
if (AssumedTemplate != AssumedTemplateKind::None) {

clang/test/SemaCXX/static-assert-cxx17.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void foo6() {
9696
// expected-error@-1{{static assertion failed due to requirement 'static_cast<const X<int> *>(nullptr)'}}
9797
static_assert((const X<typename T::T>[]){} == nullptr);
9898
// expected-error@-1{{static assertion failed due to requirement '(const X<int>[0]){} == nullptr'}}
99-
static_assert(sizeof(X<decltype(X<typename T::T>().template X<typename T::T>::~X())>) == 0);
99+
static_assert(sizeof(X<decltype(X<typename T::T>().X<typename T::T>::~X())>) == 0);
100100
// expected-error@-1{{static assertion failed due to requirement 'sizeof(X<void>) == 0'}} \
101101
// expected-note@-1 {{evaluates to '8 == 0'}}
102102
static_assert(constexpr_return_false<typename T::T, typename T::U>());

0 commit comments

Comments
 (0)