Skip to content

Spurrious auto parsing when looking up a TClass #17992

Closed
@pcanal

Description

@pcanal

Check duplicate issues.

  • Checked for duplicates

Description

As seen in cms-sw/cmssw#47470 in some circumstances calling TClass::GetClass may lead to an unnecessary/unwanted loading of the header files.

Reproducer

In the example, there is a lookup for vector<edm::Ref<vector<l1t::TkElectron>,l1t::TkElectron,edm::refhelper::FindUsingAdvance<vector<l1t::TkElectron>,l1t::TkElectron> > >
which, because it is a normalized class name lead to a code path where we do

  1. auloading the library needed for this class and it dependencies
  2. attempt to normalize the name and resolve potential typedefs
  3. check for the dictionary.
    However in this case edm::refhelper::FindUsingAdvance<vector<l1t::TkElectron>,l1t::TkElectron> > is intentionally not known to core/meta/TClass and thus the name normalization must check if it is a typedef and this step triggers the (auto) parsing of the headers (for l1t::TkElectron).

This can be solved by executing between 1 and 2:
1a. check for dictionary with the name as is.

ROOT version

at least 6.32 up to master (probably more)

Installation method

any

Operating system

any

Additional context

No response

Metadata

Metadata

Assignees

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions