Skip to content

Commit 5e5b8fb

Browse files
committed
Update SemaDecl.cpp
1 parent e6fcc5e commit 5e5b8fb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clang/lib/Sema/SemaDecl.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19245,10 +19245,8 @@ void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl,
1924519245

1924619246
// Maybe randomize the record's decls. We automatically randomize a record
1924719247
// of function pointers, unless it has the "no_randomize_layout" attribute.
19248-
if ((Record->hasAttr<RandomizeLayoutAttr>() ||
19249-
(!Record->hasAttr<NoRandomizeLayoutAttr>() &&
19250-
llvm::all_of(Record->decls(), IsFunctionPointerOrForwardDecl))) &&
19251-
!Record->isUnion() && !Record->isRandomized()) {
19248+
if (Record->hasAttr<RandomizeLayoutAttr>() && !Record->isUnion() &&
19249+
!Record->isRandomized()) {
1925219250
SmallVector<Decl *, 32> NewDeclOrdering;
1925319251
if (randstruct::randomizeStructureLayout(Context, Record,
1925419252
NewDeclOrdering))

0 commit comments

Comments
 (0)