From 258322105892bd895a89ccbe89487885581f5a47 Mon Sep 17 00:00:00 2001 From: John Brawn Date: Wed, 5 Jul 2023 17:39:59 +0100 Subject: [PATCH] Fix compile error in UnresolvedSetTest.cpp with -Wall A stage 2 buildbot that compiles with -Wall -Werror is showing a failure because a dummy value is unused. Use the unused attribute to suppress the warning, and add a comment about why we have this value. --- clang/unittests/AST/UnresolvedSetTest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clang/unittests/AST/UnresolvedSetTest.cpp b/clang/unittests/AST/UnresolvedSetTest.cpp index 6c4d6db..147c42e 100644 --- a/clang/unittests/AST/UnresolvedSetTest.cpp +++ b/clang/unittests/AST/UnresolvedSetTest.cpp @@ -3,7 +3,9 @@ namespace clang { class NamedDecl { - int dummy; + // DeclAccessPair assumes that NamedDecl is at least 4-byte aligned, so we + // we need to have a dummy value to make this dummy NamedDecl also be aligned. + int dummy __attribute__((unused)); public: NamedDecl() {} -- 2.7.4