[cling] lambdas have unexpected semantics in the interactive interpreter
メンテナーはふだん 1 日以内に返信
@devajithvs がすでに取り組んでいます。
2026年6月16日 から。
評価
この issue はまだ評価されていません。
説明
Explain what you would like to see improved and how.
Running the following lines in the interpreter (line by line, not as a macro) produces an unexpected result (as in, a result that doesn't logically follow from surface knowledge of how the interpreter treats line-by-line statements + how C++ behaves):
int foo = 1
auto f = [=] { return foo; }
f()
foo = 2
f()
Expected output:
(int) 1
(int) 1
Actual output:
ROOT_prompt_1:1:1: warning: captures will be by reference, not copy
auto f = [=]{return foo;}
^
(int) 1
(int) 2
The same happens if we use explicit capture by name: auto f = [foo=foo] { return foo; }.
This is unexpected because, even knowing the variable declarations will be hoisted to the global scope, in regular C++:
- one cannot declare a global capture-default lambda; (should not compile)
- one can declare a global capture-by-named-copy lambda (
[foo=foo]) and it works as expected (captures the value, not the reference).
NOTE: running the same code as a macro works as expected.
ROOT version
master
Installation method
any
Operating system
Linux (likely any)
Additional context
No response
- 主要言語
- C++
- スター
- 3.3k
- フォーク
- 1.6k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 211
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
root-project/root のほかの issue
-
thisroot.sh: wrong ROOTSYS in zsh when the shell's command line has a newline対応中かも @dpiparo が 10 日前に担当しました。 オープンbug in:Build System
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
root-project/root#23746 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Header cleanup campaign対応中かも @hageboeck が 1 日前に担当しました。 オープンimprovement in:Core Libraries
root-project/root#23880 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
TDataMember::GetOffset interfers to TDataMember::GetOffsetCint対応中かも @pcanal が 7 日前に担当しました。 オープンbug in:Core Libraries
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
root-project/root#23777 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
`TChain::GetEntries` internal caching ineffective?対応中かも @pcanal が 13 日前に担当しました。 オープンimprovement in:TTree
root-project/root#23738 · コメント 6 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[PyROOT] Segfault at exit deleting a branch with a Cling-generated collection destructor after cppyy instantiated a template対応中かも @guitargeek が 13 日前に担当しました。 オープンbug in:Python Interface test wit cppjit
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
root-project/root#23728 · コメント 9 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
root-project/root の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
enhancement Ready for final check
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
mpogue2/SquareDesk#1818 · コメント 1 件 ·
-
launch-client --save-creds creates creds/<account>/ with mode 755, not 700対応中かも @metis-sprock が今日担当しました。 オープンbacklog bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
EchoTools/nevr-runtime#1471 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
iamankushpandit/Gume#231 ·
メンテナーはふだん 1 日以内に返信