Skip to content

Commit f0904d7

Browse files
committed
fix regression
1 parent eeaa306 commit f0904d7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3747,7 +3747,7 @@ 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 (!Pointee->isStructureOrClassType() ||
3750+
if (Pointee->isEnumeralType() ||
37513751
!RequireCompleteType(StartLoc, Pointee,
37523752
LangOpts.CPlusPlus26
37533753
? diag::err_delete_incomplete

clang/test/SemaCXX/new-delete.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,15 @@ enum GH99278_1 {
545545
zero = decltype(delete static_cast<GH99278_1*>(nullptr), 0){}
546546
// expected-warning@-1 {{expression with side effects has no effect in an unevaluated context}}
547547
};
548+
template <typename = void>
549+
struct GH99278_2 {
550+
union b {};
551+
struct c {
552+
c() { delete d; }
553+
b *d;
554+
} f;
555+
};
556+
GH99278_2<void> e;
548557
#endif
549558

550559
struct PlacementArg {};

0 commit comments

Comments
 (0)