[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
This commit is contained in:
Owen Pan
2024-05-10 23:07:23 -07:00
parent 4f127667ca
commit 5cd280433e

View File

@@ -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;