Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions core/rint/src/TTabCom.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 *//
}

Expand Down Expand Up @@ -2500,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.
Expand Down
33 changes: 26 additions & 7 deletions roottest/root/rint/TabCom.eref
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
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
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
;
^
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
;
^
Expand All @@ -34,3 +44,12 @@ 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
;
^
ROOT_prompt_30:2:1: error: expected unqualified-id
;
^
ROOT_prompt_32:2:1: error: expected unqualified-id
;
^
10 changes: 10 additions & 0 deletions roottest/root/rint/TabCom.oref
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ MyCla ::fgM
MyCla ::fgPrivateM
TH1F *h = 0;
h->GetXaxis()->SetTi
x.
x->
struct Simple {};
Simple s;
s.
s->
const Simple cs{};
cs.
Simple* ps = nullptr;
ps->
ps.
std::unique_ptr<Simple> us;
us->
const Simple* pcs = nullptr;
pcs->
Simple* const cps = nullptr;
Expand Down Expand Up @@ -107,3 +113,7 @@ operator=
Simple
operator=
~Simple

Simple
operator=
~Simple
117 changes: 0 additions & 117 deletions roottest/root/rint/TabCom.ref

This file was deleted.

6 changes: 6 additions & 0 deletions roottest/root/rint/TabCom_input.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ MyCla ::fgM
MyCla ::fgPrivateM
TH1F *h = 0;
h->GetXaxis()->SetTi
x.
x->
struct Simple {};
Simple s;
s.
s->
const Simple cs{};
cs.
Simple* ps = nullptr;
ps->
ps.
std::unique_ptr<Simple> us;
us->
const Simple* pcs = nullptr;
pcs->
Simple* const cps = nullptr;
Expand Down
Loading