[clang] 5cd2804 - [clang-format] Move QualifierFixerTest::LangOpts to IsQualifierType test

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Fri May 10 23:15:06 PDT 2024


Author: Owen Pan
Date: 2024-05-10T23:14:58-07:00
New Revision: 5cd280433e8e063bf3c2390eaf152e726db5b0fb

URL: https://github.com/llvm/llvm-project/commit/5cd280433e8e063bf3c2390eaf152e726db5b0fb
DIFF: https://github.com/llvm/llvm-project/commit/5cd280433e8e063bf3c2390eaf152e726db5b0fb.diff

LOG: [clang-format] Move QualifierFixerTest::LangOpts to IsQualifierType test

This should fix buildbot failures in:
https://lab.llvm.org/buildbot/#/builders/5/builds/43303
https://lab.llvm.org/buildbot/#/builders/168/builds/20347

Added: 
    

Modified: 
    clang/unittests/Format/QualifierFixerTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Format/QualifierFixerTest.cpp b/clang/unittests/Format/QualifierFixerTest.cpp
index ada47549fd0b3..5463bfbb65ca6 100644
--- a/clang/unittests/Format/QualifierFixerTest.cpp
+++ b/clang/unittests/Format/QualifierFixerTest.cpp
@@ -27,15 +27,11 @@ namespace {
   EXPECT_EQ(VALUE, Style.FIELD) << "Unexpected value after parsing!"
 
 class QualifierFixerTest : public FormatTestBase {
-public:
-  QualifierFixerTest() : LangOpts(getFormattingLangOpts()) {}
-
 protected:
   TokenList annotate(llvm::StringRef Code,
                      const FormatStyle &Style = getLLVMStyle()) {
     return TestLexer(Allocator, Buffers, Style).annotate(Code);
   }
-  LangOptions LangOpts;
   llvm::SpecificBumpPtrAllocator<FormatToken> Allocator;
   std::vector<std::unique_ptr<llvm::MemoryBuffer>> Buffers;
 };
@@ -1059,6 +1055,8 @@ TEST_F(QualifierFixerTest, IsQualifierType) {
   ConfiguredTokens.push_back(tok::kw_constexpr);
   ConfiguredTokens.push_back(tok::kw_friend);
 
+  LangOptions LangOpts{getFormattingLangOpts()};
+
   auto Tokens = annotate(
       "const static inline auto restrict int double long constexpr friend");
   ASSERT_EQ(Tokens.size(), 11u) << Tokens;


        


More information about the cfe-commits mailing list