Skip to content

Commit d70e7c2

Browse files
committed
Fixed a few things from Aaron
1 parent 3e8f013 commit d70e7c2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ Bug Fixes to Attribute Support
500500
- Fixes crashes or missing diagnostics with the `device_kernel` attribute. (#GH161905)
501501
- Fix handling of parameter indexes when an attribute is applied to a C++23 explicit object member function.
502502
- Fixed several false positives and false negatives in function effect (`nonblocking`) analysis. (#GH166078) (#GH166101) (#GH166110)
503-
- Fix ``cleanup`` attribute by delaying type checks after the type is deduced. (#GH129631)
503+
- Fix ``cleanup`` attribute by delaying type checks until after the type is deduced. (#GH129631)
504504

505505
Bug Fixes to C++ Support
506506
^^^^^^^^^^^^^^^^^^^^^^^^

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8303,14 +8303,15 @@ void Sema::redelayDiagnostics(DelayedDiagnosticPool &pool) {
83038303
}
83048304

83058305
void Sema::ActOnCleanupAttr(Decl *D, const Attr *A) {
8306+
VarDecl *VD = cast<VarDecl>(D);
8307+
if (VD->getType()->isDependentType())
8308+
return;
8309+
83068310
// Obtains the FunctionDecl that was found when handling the attribute
83078311
// earlier.
83088312
CleanupAttr *Attr = D->getAttr<CleanupAttr>();
83098313
FunctionDecl *FD = Attr->getFunctionDecl();
83108314
DeclarationNameInfo NI = FD->getNameInfo();
8311-
VarDecl *VD = cast<VarDecl>(D);
8312-
if (VD->getType()->isDependentType())
8313-
return;
83148315

83158316
// We're currently more strict than GCC about what function types we accept.
83168317
// If this ever proves to be a problem it should be easy to fix.

0 commit comments

Comments
 (0)