Fix compile error in UnresolvedSetTest.cpp with -Wall
authorJohn Brawn <john.brawn@arm.com>
Wed, 5 Jul 2023 16:39:59 +0000 (17:39 +0100)
committerJohn Brawn <john.brawn@arm.com>
Wed, 5 Jul 2023 16:39:59 +0000 (17:39 +0100)
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

index 6c4d6db..147c42e 100644 (file)
@@ -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() {}