Skip to content

Commit 72a6205

Browse files
committed
Tidying up and removing irrelevant comments
1 parent 7f84982 commit 72a6205

File tree

5 files changed

+4
-20
lines changed

5 files changed

+4
-20
lines changed

clang/lib/CodeGen/CGExprCXX.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,8 +1394,6 @@ static UsualDeleteParams getUsualDeleteParams(const FunctionDecl *FD) {
13941394
auto AI = FPT->param_type_begin(), AE = FPT->param_type_end();
13951395

13961396
if (FD->isTypeAwareOperatorNewOrDelete()) {
1397-
// Assume Sema has ensured a non-pointer first parameter is
1398-
// a type identity.
13991397
Params.TypeAwareDelete = TypeAwareAllocationMode::Yes;
14001398
assert(AI != AE);
14011399
++AI;

clang/lib/Sema/SemaCoroutine.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,8 +1433,7 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
14331433
// scope of the promise type.
14341434
// - If any declarations are found, ...
14351435
// - If no declarations are found in the scope of the promise type, a
1436-
// search is performed in the global scope or via ADL for typed
1437-
// allocation.
1436+
// search is performed in the global scope.
14381437
if (NewScope == Sema::AFS_Both)
14391438
NewScope = PromiseContainsNew ? Sema::AFS_Class : Sema::AFS_Global;
14401439

clang/lib/Sema/SemaDecl.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17466,19 +17466,6 @@ Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc,
1746617466
Previous.clear();
1746717467
}
1746817468

17469-
// I think DC check should be DC->isStdNamespace()?
17470-
// Also these guards are questionable - it's possible to get incorrect
17471-
// codegen when the declared type does not match the expected type.
17472-
// e.g. something like
17473-
// namespace std { struct align_val_t { explicit align_val_t(size_t); } };
17474-
// can result in an operator new/delete decl picking up this specified
17475-
// align_val_t struct, but the align_val_t constructed implicitly has the
17476-
// mismatching internal definition.
17477-
//
17478-
// The correct course of action is probably to perform this logic at the point
17479-
// a declaration is inserted into the DeclContext, where it can also perform
17480-
// appropriate type checks for warnings/errors, rather than working backwards
17481-
// from the assumption that the type will always be correct.
1748217469
if (getLangOpts().CPlusPlus && Name && DC && StdNamespace &&
1748317470
DC->Equals(getStdNamespace())) {
1748417471
if (Name->isStr("bad_alloc")) {

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10865,9 +10865,8 @@ bool Sema::CheckDestructor(CXXDestructorDecl *Destructor) {
1086510865
// first parameter, perform that conversion now.
1086610866
if (OperatorDelete->isDestroyingOperatorDelete()) {
1086710867
unsigned PointerParam = 0;
10868-
if (isTypeAwareOperatorNewOrDelete(OperatorDelete)) {
10868+
if (isTypeAwareOperatorNewOrDelete(OperatorDelete))
1086910869
++PointerParam;
10870-
}
1087110870
QualType ParamType =
1087210871
OperatorDelete->getParamDecl(PointerParam)->getType();
1087310872
if (!declaresSameEntity(ParamType->getAsCXXRecordDecl(), RD)) {

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2749,7 +2749,8 @@ static bool resolveAllocationOverloadInterior(
27492749
/*AlignArg=*/nullptr, Diagnose);
27502750
}
27512751
if (Mode == ResolveMode::Typed) {
2752-
// If we can't find a matching typed we don't consider this a failure.
2752+
// If we can't find a matching type aware operator we don't consider this a
2753+
// failure.
27532754
Operator = nullptr;
27542755
return false;
27552756
}

0 commit comments

Comments
 (0)