mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Add Ptr and RawNew for migration (#751)
Co-authored-by: Geoff Romer <gromer@google.com>
This commit is contained in:
committed by
GitHub
co-authored by
Geoff Romer
parent
1eeaa208f2
commit
c6ebe0db67
@@ -55,7 +55,8 @@ TEST(ExpressionTest, UnaryNoCommaAsExpression) {
|
||||
// ```
|
||||
ParenContents<Expression> contents = {
|
||||
.elements = {{.name = std::nullopt,
|
||||
.term = global_arena->New<IntLiteral>(/*line_num=*/2, 42)}},
|
||||
.term =
|
||||
global_arena->RawNew<IntLiteral>(/*line_num=*/2, 42)}},
|
||||
.has_trailing_comma = false};
|
||||
|
||||
const Expression* expression =
|
||||
@@ -67,7 +68,8 @@ TEST(ExpressionTest, UnaryNoCommaAsExpression) {
|
||||
TEST(ExpressionTest, UnaryNoCommaAsTuple) {
|
||||
ParenContents<Expression> contents = {
|
||||
.elements = {{.name = std::nullopt,
|
||||
.term = global_arena->New<IntLiteral>(/*line_num=*/2, 42)}},
|
||||
.term =
|
||||
global_arena->RawNew<IntLiteral>(/*line_num=*/2, 42)}},
|
||||
.has_trailing_comma = false};
|
||||
|
||||
const Expression* tuple =
|
||||
@@ -81,7 +83,8 @@ TEST(ExpressionTest, UnaryNoCommaAsTuple) {
|
||||
TEST(ExpressionTest, UnaryWithCommaAsExpression) {
|
||||
ParenContents<Expression> contents = {
|
||||
.elements = {{.name = std::nullopt,
|
||||
.term = global_arena->New<IntLiteral>(/*line_num=*/2, 42)}},
|
||||
.term =
|
||||
global_arena->RawNew<IntLiteral>(/*line_num=*/2, 42)}},
|
||||
.has_trailing_comma = true};
|
||||
|
||||
const Expression* expression =
|
||||
@@ -95,7 +98,8 @@ TEST(ExpressionTest, UnaryWithCommaAsExpression) {
|
||||
TEST(ExpressionTest, UnaryWithCommaAsTuple) {
|
||||
ParenContents<Expression> contents = {
|
||||
.elements = {{.name = std::nullopt,
|
||||
.term = global_arena->New<IntLiteral>(/*line_num=*/2, 42)}},
|
||||
.term =
|
||||
global_arena->RawNew<IntLiteral>(/*line_num=*/2, 42)}},
|
||||
.has_trailing_comma = true};
|
||||
|
||||
const Expression* tuple =
|
||||
@@ -109,9 +113,11 @@ TEST(ExpressionTest, UnaryWithCommaAsTuple) {
|
||||
TEST(ExpressionTest, BinaryAsExpression) {
|
||||
ParenContents<Expression> contents = {
|
||||
.elements = {{.name = std::nullopt,
|
||||
.term = global_arena->New<IntLiteral>(/*line_num=*/2, 42)},
|
||||
.term =
|
||||
global_arena->RawNew<IntLiteral>(/*line_num=*/2, 42)},
|
||||
{.name = std::nullopt,
|
||||
.term = global_arena->New<IntLiteral>(/*line_num=*/3, 42)}},
|
||||
.term =
|
||||
global_arena->RawNew<IntLiteral>(/*line_num=*/3, 42)}},
|
||||
.has_trailing_comma = true};
|
||||
|
||||
const Expression* expression =
|
||||
@@ -125,9 +131,11 @@ TEST(ExpressionTest, BinaryAsExpression) {
|
||||
TEST(ExpressionTest, BinaryAsTuple) {
|
||||
ParenContents<Expression> contents = {
|
||||
.elements = {{.name = std::nullopt,
|
||||
.term = global_arena->New<IntLiteral>(/*line_num=*/2, 42)},
|
||||
.term =
|
||||
global_arena->RawNew<IntLiteral>(/*line_num=*/2, 42)},
|
||||
{.name = std::nullopt,
|
||||
.term = global_arena->New<IntLiteral>(/*line_num=*/3, 42)}},
|
||||
.term =
|
||||
global_arena->RawNew<IntLiteral>(/*line_num=*/3, 42)}},
|
||||
.has_trailing_comma = true};
|
||||
|
||||
const Expression* tuple =
|
||||
|
||||
Reference in New Issue
Block a user