Skip to content

Commit eeaa306

Browse files
committed
remove warning
1 parent 8b89f6a commit eeaa306

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3747,9 +3747,9 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
37473747
} else if (!Pointee->isDependentType()) {
37483748
// FIXME: This can result in errors if the definition was imported from a
37493749
// module but is hidden.
3750-
if (!RequireCompleteType(StartLoc, Pointee,
3751-
Pointee->isStructureOrClassType() &&
3752-
LangOpts.CPlusPlus26
3750+
if (!Pointee->isStructureOrClassType() ||
3751+
!RequireCompleteType(StartLoc, Pointee,
3752+
LangOpts.CPlusPlus26
37533753
? diag::err_delete_incomplete
37543754
: diag::warn_delete_incomplete,
37553755
Ex.get())) {

clang/test/SemaCXX/new-delete.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,9 @@ namespace PR10504 {
541541
}
542542

543543
#if __cplusplus >= 201103L
544-
enum GH99278_1 { // expected-note {{definition of 'GH99278_1' is not complete until the closing '}'}}
544+
enum GH99278_1 {
545545
zero = decltype(delete static_cast<GH99278_1*>(nullptr), 0){}
546-
// expected-warning@-1 {{deleting pointer to incomplete type}}
547-
// expected-warning@-2 {{expression with side effects has no effect in an unevaluated context}}
546+
// expected-warning@-1 {{expression with side effects has no effect in an unevaluated context}}
548547
};
549548
#endif
550549

0 commit comments

Comments
 (0)