# Automatically generated dictionary for std::pair base class with libstdc++

**URL:** <https://root-forum.cern.ch/t/automatically-generated-dictionary-for-std-pair-base-class-with-libstdc/49872>\
**Category:** ROOT\
**Tags:** cling, root\
**Created:** [May 5, 2022, 3:36pm UTC](https://root-forum.cern.ch/t/automatically-generated-dictionary-for-std-pair-base-class-with-libstdc/49872 "2022-05-05T15:36:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![valerio.formato](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/valerio.formato/32/12474_2.png) [@valerio.formato](https://root-forum.cern.ch/u/valerio.formato)\
**Post date:** [May 5, 2022, 3:36pm UTC](https://root-forum.cern.ch/t/automatically-generated-dictionary-for-std-pair-base-class-with-libstdc/49872/1 "2022-05-05T15:36:35Z")

</div>

Dear ROOTers,  
I’ve come across a puzzling error message when trying to open a file with a non-trivial `TTree` inside which contains lots of custom classes and std containers/types.  
The file was produced on a CentOS7 machine, and I am opening it on a MacBook.

The puzzling errors are all related to `std::pair`

```auto
Warning in <TClass::Init>: no dictionary for class __pair_base<unsigned int,float> is available
...

```

I tracked down the error message to the fact that `std::pair` has an [empty base class](https://stackoverflow.com/questions/64931324/what-is-the-purpose-of-having-an-empty-pair-base-class) in the libstdc++ implementation, while this doesn’t seem the case in libc++.

I also found that this kind of issue already [presented itself in 2018](https://sft.its.cern.ch/jira/browse/ROOT-9808) and [was fixed](https://github.com/root-project/root/pull/3046) by ignoring the base class for `std::pair` in the streamer.

From the original JIRA issue I understood that the expected behavior for `std::pair` is

```auto
root [0] auto c = TClass::GetClass("pair<int,int>");auto pb = c->GetListOfBases();pb->GetEntries()
(int) 0

```

while if I perform this check on my 6.22/08 install (compiled with gcc 9.3.0 on CentOS7) I get

```auto
root [0] auto c = TClass::GetClass("pair<int,int>");auto pb = c->GetListOfBases();pb->GetEntries()
(int) 1

```

(this particular ROOT install is available on cvmfs: `/cvmfs/ams.cern.ch/Offline/amsitaly/public/install/x86_64-centos7-gcc9.3/root-6.22.08`)

So, my question is, is this a regression? Or is this intended behavior?  
In the latter case, how can I avoid the truckload of warnings when opening files on my MacBook?

Cheers,  
Valerio

* * *

_ROOT Version:_ 6.22/08  
_Platform:_ CentOS7  
_Compiler:_ gcc 9.3.0

* * *

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [May 5, 2022, 4:30pm UTC](https://root-forum.cern.ch/t/automatically-generated-dictionary-for-std-pair-base-class-with-libstdc/49872/2 "2022-05-05T16:30:09Z")

</div>

Maybe @pcanal can take a look at this

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [May 5, 2022, 4:39pm UTC](https://root-forum.cern.ch/t/automatically-generated-dictionary-for-std-pair-base-class-with-libstdc/49872/3 "2022-05-05T16:39:56Z")

</div>

The warning can be safely ignored. I can not remember if this is a regression or a not-yet-fixed combination (v6.22 is rather old) but this have been fixed on the tip of the v6.22 patch branch (will eventually be in v6.22/10), the tip of the v6.24 patch branch (will eventually be in v6.24/08) and the tip of the v6.26 patch branch and the released v6.26/02 (i.e. I recommend you upgrade to v6.26/02)

---

<div class="post-metadata">

**Author:** ![valerio.formato](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/valerio.formato/32/12474_2.png) [@valerio.formato](https://root-forum.cern.ch/u/valerio.formato)\
**Post date:** [May 5, 2022, 5:02pm UTC](https://root-forum.cern.ch/t/automatically-generated-dictionary-for-std-pair-base-class-with-libstdc/49872/4 "2022-05-05T17:02:35Z")

</div>

Oh ok thanks, it’s cool that the fix was already in-flight 🙂

Of course this will require us to upgrade ROOT version, so at this point we’ll jump directly to 6.26/02

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [May 19, 2022, 5:03pm UTC](https://root-forum.cern.ch/t/automatically-generated-dictionary-for-std-pair-base-class-with-libstdc/49872/5 "2022-05-19T17:03:06Z")

</div>

Closed on May 19, 2022, 5:03pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
