diff options
author | Owen Pan <owenpiano@gmail.com> | 2024-05-10 23:07:23 -0700 |
---|---|---|
committer | Owen Pan <owenpiano@gmail.com> | 2024-05-10 23:14:58 -0700 |
commit | 5cd280433e8e063bf3c2390eaf152e726db5b0fb (patch) | |
tree | 89873fb095b91c3ff1e855eb82263b1d39ee7d46 | |
parent | 4f127667ca57875f0984f81d5790479b902022e0 (diff) | |
download | llvm-5cd280433e8e063bf3c2390eaf152e726db5b0fb.tar.gz |
[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
-rw-r--r-- | clang/unittests/Format/QualifierFixerTest.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/unittests/Format/QualifierFixerTest.cpp b/clang/unittests/Format/QualifierFixerTest.cpp index ada47549fd0b..5463bfbb65ca 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; |