Skip to content

Commit ba10c1d

Browse files
authored
[clang][NFC] Code Cleanup of inferred noreturn attributes in explicit specializations. (#151815)
Addressing #150003 (comment)
1 parent d03692a commit ba10c1d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

clang/lib/Sema/SemaDecl.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,11 +3269,10 @@ void Sema::mergeDeclAttributes(NamedDecl *New, Decl *Old,
32693269
continue;
32703270

32713271
if (isa<InferredNoReturnAttr>(I)) {
3272-
if (auto *FD = dyn_cast<FunctionDecl>(New)) {
3273-
if (FD->getTemplateSpecializationKind() == TSK_ExplicitSpecialization)
3274-
continue; // Don't propagate inferred noreturn attributes to explicit
3275-
// specializations.
3276-
}
3272+
if (auto *FD = dyn_cast<FunctionDecl>(New);
3273+
FD &&
3274+
FD->getTemplateSpecializationKind() == TSK_ExplicitSpecialization)
3275+
continue; // Don't propagate inferred noreturn attributes to explicit
32773276
}
32783277

32793278
if (mergeDeclAttribute(*this, New, I, LocalAMK))

0 commit comments

Comments
 (0)