Skip to content

Commit 881df55

Browse files
committed
[clang] Fix -Wunused-variable in SemaChecking.cpp (NFC)
llvm-project/clang/lib/Sema/SemaChecking.cpp:19192:15: error: unused variable 'Field1Parent' [-Werror,-Wunused-variable] const Type *Field1Parent = Field1->getParent()->getTypeForDecl(); ^ llvm-project/clang/lib/Sema/SemaChecking.cpp:19193:15: error: unused variable 'Field2Parent' [-Werror,-Wunused-variable] const Type *Field2Parent = Field2->getParent()->getTypeForDecl(); ^ 2 errors generated.
1 parent dd36138 commit 881df55

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/lib/Sema/SemaChecking.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19189,8 +19189,10 @@ static bool isLayoutCompatible(ASTContext &C, EnumDecl *ED1, EnumDecl *ED2) {
1918919189
static bool isLayoutCompatible(ASTContext &C, FieldDecl *Field1,
1919019190
FieldDecl *Field2,
1919119191
bool AreUnionMembers = false) {
19192-
const Type *Field1Parent = Field1->getParent()->getTypeForDecl();
19193-
const Type *Field2Parent = Field2->getParent()->getTypeForDecl();
19192+
[[maybe_unused]] const Type *Field1Parent =
19193+
Field1->getParent()->getTypeForDecl();
19194+
[[maybe_unused]] const Type *Field2Parent =
19195+
Field2->getParent()->getTypeForDecl();
1919419196
assert(((Field1Parent->isStructureOrClassType() &&
1919519197
Field2Parent->isStructureOrClassType()) ||
1919619198
(Field1Parent->isUnionType() && Field2Parent->isUnionType())) &&

0 commit comments

Comments
 (0)