[clang] 577e0ef - [clang][AST] Silence unused-value warnings in unittest DeclPrinterTest

Alina Sbirlea via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 26 23:24:48 PDT 2024


Author: Alina Sbirlea
Date: 2024-03-26T23:24:02-07:00
New Revision: 577e0ef94fb0b4ba9f97a6f58a1961f7ba247d21

URL: https://github.com/llvm/llvm-project/commit/577e0ef94fb0b4ba9f97a6f58a1961f7ba247d21
DIFF: https://github.com/llvm/llvm-project/commit/577e0ef94fb0b4ba9f97a6f58a1961f7ba247d21.diff

LOG: [clang][AST] Silence unused-value warnings in unittest DeclPrinterTest

Added: 
    

Modified: 
    clang/unittests/AST/DeclPrinterTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/AST/DeclPrinterTest.cpp b/clang/unittests/AST/DeclPrinterTest.cpp
index 07fa02bd96e25d..8a29d0544a04bf 100644
--- a/clang/unittests/AST/DeclPrinterTest.cpp
+++ b/clang/unittests/AST/DeclPrinterTest.cpp
@@ -1391,7 +1391,7 @@ TEST(DeclPrinter, TestCXXRecordDecl17) {
                                       "struct X {};"
                                       "Z<X> A;",
                                       "A", "Z<X> A"));
-  [](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; };
+  (void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; };
 }
 
 TEST(DeclPrinter, TestCXXRecordDecl18) {
@@ -1402,7 +1402,7 @@ TEST(DeclPrinter, TestCXXRecordDecl18) {
                                       "struct Y{};"
                                       "Y<Z<X>, 2> B;",
                                       "B", "Y<Z<X>, 2> B"));
-  [](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; };
+  (void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; };
 }
 
 TEST(DeclPrinter, TestCXXRecordDecl19) {
@@ -1413,7 +1413,7 @@ TEST(DeclPrinter, TestCXXRecordDecl19) {
                                       "struct Y{};"
                                       "Y<Z<X>, 2> B;",
                                       "B", "Y<Z<X>, 2> B"));
-  [](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; };
+  (void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; };
 }
 TEST(DeclPrinter, TestCXXRecordDecl20) {
   ASSERT_TRUE(PrintedDeclCXX98Matches(
@@ -1432,7 +1432,7 @@ TEST(DeclPrinter, TestCXXRecordDecl20) {
       "Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100);",
       "nestedInstance",
       "Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100)"));
-  [](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; };
+  (void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; };
 }
 
 TEST(DeclPrinter, TestCXXRecordDecl21) {
@@ -1452,7 +1452,7 @@ TEST(DeclPrinter, TestCXXRecordDecl21) {
       "Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100);",
       "nestedInstance",
       "Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100)"));
-  [](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; };
+  (void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; };
 }
 
 TEST(DeclPrinter, TestFunctionParamUglified) {


        


More information about the cfe-commits mailing list