/
githubmirror
/
carbon-lang
Обзор
Документация
Войти
/
githubmirror
/
carbon-lang
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
toolchain/check/handle_codeblock.cpp
27 строк
904 B
Richard Smith
Destroy temporaries at the end of expression statements. (#7513)
16 июл 2026, 18:12
Не верифицирован
16 июл 2026, 18:12
703529f
Код
Авторство
О чём код?
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "toolchain/check/context.h" #include "toolchain/check/control_flow.h" #include "toolchain/check/handle.h" #include "toolchain/check/unused.h" namespace Carbon::Check { auto HandleParseNode(Context& context, Parse::CodeBlockStartId node_id) -> bool { context.node_stack().Push(node_id); context.scope_stack().PushForSameRegion(ScopeStack::CleanupScopeKind::Owned); return true; } auto HandleParseNode(Context& context, Parse::CodeBlockId /*node_id*/) -> bool { AddAndDiscardScopeCleanups(context); context.scope_stack().Pop(/*check_unused=*/true); context.node_stack() .PopAndDiscardSoloNodeId<Parse::NodeKind::CodeBlockStart>(); return true; } } // namespace Carbon::Check