From bc61deb3caf8b9f7d0ace02c602207cc3dcadb71 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Tue, 12 May 2026 15:10:40 +0200 Subject: [PATCH 1/5] [roottest] Delete unused TabCom.ref --- roottest/root/rint/TabCom.ref | 117 ---------------------------------- 1 file changed, 117 deletions(-) delete mode 100644 roottest/root/rint/TabCom.ref diff --git a/roottest/root/rint/TabCom.ref b/roottest/root/rint/TabCom.ref deleted file mode 100644 index 5e9edb61450d4..0000000000000 --- a/roottest/root/rint/TabCom.ref +++ /dev/null @@ -1,117 +0,0 @@ -TObj -TObject::k -gROOT->GetListOfT -TNamed tabComTestNamedObj("AName","ATitle"); -tabComTestNamedOb .SetTitl "OtherTitle") -tabComTestNamedOb .GetTitl () -#include "MyClass.h" -MyCla ::fgM -MyCla ::fgPrivateM -TH1F *h = 0; -h->GetXaxis()->SetTi -struct Simple {}; -Simple s; -s. -const Simple cs{}; -cs. -Simple* ps = nullptr; -ps-> -const Simple* pcs = nullptr; -pcs-> -Simple* const cps = nullptr; -cps-> -const Simple* const cpcs = nullptr; -cpcs-> -volatile Simple* vs = nullptr; -vs-> -const volatile Simple* cvs = nullptr; -cvs-> -.q - - -TObjArray -TObjArrayIter -TObjString -TObject -TObjectRefSpy -TObjectSpy -TObjectTable - -kBitMask -kCanDelete -kCannotPick -kHasUUID -kInvalidObject -kIsOnHeap -kIsReferenced -kMustCleanup -kNoContextMenu -kNotDeleted -kObjInCanvas -kOverwrite -kSingleKey -kWriteDelete -kZombie - -GetListOfTasks -GetListOfTypes - -void SetTitle(const char* title = "") // *MENU* -(const char *) "OtherTitle" -(int) 42 - -SetTickLength -SetTickSize -SetTicks -SetTimeDisplay -SetTimeFormat -SetTimeOffset -SetTitle -SetTitleColor -SetTitleFont -SetTitleOffset -SetTitleSize - -SetTickLength -SetTickSize -SetTicks -SetTimeDisplay -SetTimeFormat -SetTimeOffset -SetTitle -SetTitleColor -SetTitleFont -SetTitleOffset -SetTitleSize - -Simple -operator= -~Simple - -Simple -operator= -~Simple - -Simple -operator= -~Simple - -Simple -operator= -~Simple - -Simple -operator= -~Simple - -Simple -operator= -~Simple - -Simple -operator= -~Simple - -Simple -operator= -~Simple From ca21b86eb09016322fe8c0404d42f690d90dac52 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Tue, 12 May 2026 15:31:32 +0200 Subject: [PATCH 2/5] [roottest] Update TabCom.eref --- roottest/root/rint/TabCom.eref | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roottest/root/rint/TabCom.eref b/roottest/root/rint/TabCom.eref index c4117fcc12b60..41352a9a6a995 100644 --- a/roottest/root/rint/TabCom.eref +++ b/roottest/root/rint/TabCom.eref @@ -1,13 +1,13 @@ -ROOT_prompt_1:1:10: error: no member named 'k' in 'TObject' +ROOT_prompt_0:1:10: error: no member named 'k' in 'TObject' TObject::k ~~~~~~~~~^ -ROOT_prompt_2:1:8: error: no member named 'GetListOfT' in 'TROOT' +ROOT_prompt_1:1:8: error: no member named 'GetListOfT' in 'TROOT' gROOT->GetListOfT ~~~~~ ^ -ROOT_prompt_8:1:10: error: no member named 'fgPrivateM' in 'MyClass' +ROOT_prompt_7:1:10: error: no member named 'fgPrivateM' in 'MyClass' MyClass::fgPrivateM ~~~~~~~~~^ -ROOT_prompt_10:1:16: error: no member named 'SetTi' in 'TAxis' +ROOT_prompt_9:1:16: error: no member named 'SetTi' in 'TAxis' h->GetXaxis()->SetTi ~~~~~~~~~~~~~ ^ ROOT_prompt_12:2:1: error: expected unqualified-id From eba0ab964966158856a611ce8e70361d1f9d72b0 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Tue, 12 May 2026 15:35:59 +0200 Subject: [PATCH 3/5] [TTabCom] Avoid duplicate variable error Before, the modified roottest would print variable "x" not defined. variable "x." not defined. --- core/rint/src/TTabCom.cxx | 5 +++-- roottest/root/rint/TabCom.eref | 10 +++++++++- roottest/root/rint/TabCom.oref | 2 ++ roottest/root/rint/TabCom_input.txt | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/core/rint/src/TTabCom.cxx b/core/rint/src/TTabCom.cxx index 7977a54775b80..54c16951109bf 100644 --- a/core/rint/src/TTabCom.cxx +++ b/core/rint/src/TTabCom.cxx @@ -2409,8 +2409,9 @@ TClass *TTabCom::MakeClassFromVarName(const char varName[], // not found... if (!varName_exists) { - std::cerr << std::endl << "variable " << dblquote(varName) << " not defined." - << std::endl; + if (cut == 0) { + std::cerr << std::endl << "variable " << dblquote(varName) << " not defined." << std::endl; + } return nullptr; //* RETURN *// } diff --git a/roottest/root/rint/TabCom.eref b/roottest/root/rint/TabCom.eref index 41352a9a6a995..262447d406bcb 100644 --- a/roottest/root/rint/TabCom.eref +++ b/roottest/root/rint/TabCom.eref @@ -10,7 +10,12 @@ MyClass::fgPrivateM ROOT_prompt_9:1:16: error: no member named 'SetTi' in 'TAxis' h->GetXaxis()->SetTi ~~~~~~~~~~~~~ ^ -ROOT_prompt_12:2:1: error: expected unqualified-id +variable "x" not defined. +ROOT_prompt_10:2:1: error: expected unqualified-id +; +^ +variable "x" not defined. +ROOT_prompt_11:2:1: error: expected unqualified-id ; ^ ROOT_prompt_14:2:1: error: expected unqualified-id @@ -34,3 +39,6 @@ ROOT_prompt_24:2:1: error: expected unqualified-id ROOT_prompt_26:2:1: error: expected unqualified-id ; ^ +ROOT_prompt_28:2:1: error: expected unqualified-id +; +^ diff --git a/roottest/root/rint/TabCom.oref b/roottest/root/rint/TabCom.oref index 1d8678ef837e4..b3a3e9e84c599 100644 --- a/roottest/root/rint/TabCom.oref +++ b/roottest/root/rint/TabCom.oref @@ -8,6 +8,8 @@ MyCla ::fgM MyCla ::fgPrivateM TH1F *h = 0; h->GetXaxis()->SetTi +x. +x-> struct Simple {}; Simple s; s. diff --git a/roottest/root/rint/TabCom_input.txt b/roottest/root/rint/TabCom_input.txt index 503d34a95b8df..7cde16d7de936 100644 --- a/roottest/root/rint/TabCom_input.txt +++ b/roottest/root/rint/TabCom_input.txt @@ -8,6 +8,8 @@ MyCla ::fgM MyCla ::fgPrivateM TH1F *h = 0; h->GetXaxis()->SetTi +x. +x-> struct Simple {}; Simple s; s. From 6312ca252d80bf97021a9670d295d52659d3553e Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Tue, 12 May 2026 15:41:38 +0200 Subject: [PATCH 4/5] [roottest] Test tab completion of operators --- roottest/root/rint/TabCom.eref | 12 ++++++++++-- roottest/root/rint/TabCom.oref | 2 ++ roottest/root/rint/TabCom_input.txt | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/roottest/root/rint/TabCom.eref b/roottest/root/rint/TabCom.eref index 262447d406bcb..a1d4b81063608 100644 --- a/roottest/root/rint/TabCom.eref +++ b/roottest/root/rint/TabCom.eref @@ -21,12 +21,17 @@ ROOT_prompt_11:2:1: error: expected unqualified-id ROOT_prompt_14:2:1: error: expected unqualified-id ; ^ -ROOT_prompt_16:2:1: error: expected unqualified-id +"s" is not of pointer type. Use this operator: . +ROOT_prompt_15:2:1: error: expected unqualified-id ; ^ -ROOT_prompt_18:2:1: error: expected unqualified-id +ROOT_prompt_17:2:1: error: expected unqualified-id ; ^ +ROOT_prompt_19:2:1: error: expected unqualified-id +; +^ +"ps" is of pointer type. Use this operator: -> ROOT_prompt_20:2:1: error: expected unqualified-id ; ^ @@ -42,3 +47,6 @@ ROOT_prompt_26:2:1: error: expected unqualified-id ROOT_prompt_28:2:1: error: expected unqualified-id ; ^ +ROOT_prompt_30:2:1: error: expected unqualified-id +; +^ diff --git a/roottest/root/rint/TabCom.oref b/roottest/root/rint/TabCom.oref index b3a3e9e84c599..d419894b5fa88 100644 --- a/roottest/root/rint/TabCom.oref +++ b/roottest/root/rint/TabCom.oref @@ -13,10 +13,12 @@ x-> struct Simple {}; Simple s; s. +s-> const Simple cs{}; cs. Simple* ps = nullptr; ps-> +ps. const Simple* pcs = nullptr; pcs-> Simple* const cps = nullptr; diff --git a/roottest/root/rint/TabCom_input.txt b/roottest/root/rint/TabCom_input.txt index 7cde16d7de936..cda9bfaec0b8c 100644 --- a/roottest/root/rint/TabCom_input.txt +++ b/roottest/root/rint/TabCom_input.txt @@ -13,10 +13,12 @@ x-> struct Simple {}; Simple s; s. +s-> const Simple cs{}; cs. Simple* ps = nullptr; ps-> +ps. const Simple* pcs = nullptr; pcs-> Simple* const cps = nullptr; From 90d6514dad87b0b02ebd597eb83234aba2c4058b Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Tue, 12 May 2026 15:46:00 +0200 Subject: [PATCH 5/5] [TTabCom] Auto-complete through operator-> Fixes #22019 --- core/rint/src/TTabCom.cxx | 14 ++++++++++++++ roottest/root/rint/TabCom.eref | 3 +++ roottest/root/rint/TabCom.oref | 6 ++++++ roottest/root/rint/TabCom_input.txt | 2 ++ 4 files changed, 25 insertions(+) diff --git a/core/rint/src/TTabCom.cxx b/core/rint/src/TTabCom.cxx index 54c16951109bf..8af741db377fb 100644 --- a/core/rint/src/TTabCom.cxx +++ b/core/rint/src/TTabCom.cxx @@ -2501,6 +2501,20 @@ TClass *TTabCom::MakeClassFromVarName(const char varName[], return nullptr; // RETURN } } else { + // Find the TClass and see if the object has an operator->, for example if it is a smart pointer. + auto cl = TClass::GetClass(className); + if (cl != nullptr) { + auto op = cl->GetMethod("operator->", ""); + if (op != nullptr) { + // Get the return type and remove the '*', which should be there + className = op->GetReturnTypeNormalizedName(); + if (className[className.Length() - 1] == '*') { + className.Chop(); + } + return TClass::GetClass(className); + } + } + // user is using operator->() instead of operator.() // ==> // 1. we are in wrong context. diff --git a/roottest/root/rint/TabCom.eref b/roottest/root/rint/TabCom.eref index a1d4b81063608..04e768f57f99f 100644 --- a/roottest/root/rint/TabCom.eref +++ b/roottest/root/rint/TabCom.eref @@ -50,3 +50,6 @@ ROOT_prompt_28:2:1: error: expected unqualified-id ROOT_prompt_30:2:1: error: expected unqualified-id ; ^ +ROOT_prompt_32:2:1: error: expected unqualified-id +; +^ diff --git a/roottest/root/rint/TabCom.oref b/roottest/root/rint/TabCom.oref index d419894b5fa88..9b85e0735cc05 100644 --- a/roottest/root/rint/TabCom.oref +++ b/roottest/root/rint/TabCom.oref @@ -19,6 +19,8 @@ cs. Simple* ps = nullptr; ps-> ps. +std::unique_ptr us; +us-> const Simple* pcs = nullptr; pcs-> Simple* const cps = nullptr; @@ -111,3 +113,7 @@ operator= Simple operator= ~Simple + +Simple +operator= +~Simple diff --git a/roottest/root/rint/TabCom_input.txt b/roottest/root/rint/TabCom_input.txt index cda9bfaec0b8c..cb70388388811 100644 --- a/roottest/root/rint/TabCom_input.txt +++ b/roottest/root/rint/TabCom_input.txt @@ -19,6 +19,8 @@ cs. Simple* ps = nullptr; ps-> ps. +std::unique_ptr us; +us-> const Simple* pcs = nullptr; pcs-> Simple* const cps = nullptr;