Remove default constructor from IndexBase (#2598)

There were some notes about default constructors being required in parse_tree.h, but they don't seem to be. Removing the default constructor forces the explicit `::Invalid` where there's no value immediately being assigned, which works fine for existing code. I think this actually reduces the chance of accidents more than the prior default-construct-as-invalid approach.
This commit is contained in:
Jon Ross-Perkins
2023-02-10 12:00:50 -08:00
committed by GitHub
parent aa307b1144
commit b76bc875c4
7 changed files with 28 additions and 30 deletions
-5
View File
@@ -39,11 +39,6 @@ class ParseTreeTest : public ::testing::Test {
DiagnosticConsumer& consumer = ConsoleDiagnosticConsumer();
};
TEST_F(ParseTreeTest, DefaultInvalid) {
ParseTree::Node node;
EXPECT_FALSE(node.is_valid());
}
TEST_F(ParseTreeTest, IsValid) {
TokenizedBuffer tokens = GetTokenizedBuffer("");
ParseTree tree = ParseTree::Parse(tokens, consumer, /*vlog_stream=*/nullptr);