Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9505

Template forward declaration is missing in the .rootmap

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 6.12/06
    • Fix Version/s: 6.16/00, 6.14/02
    • Component/s: Cling
    • Labels:
      None
    • Environment:

      Distributor ID: Ubuntu
      Description: Ubuntu 17.10
      Release: 17.10
      Codename: artful

      gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3.2)

    • Development:

      Description

      Hello,

      The templated class forward declaration does not appear in the rootmap unless the LinkDef includes at least one specialization of this class with a trivial type as template parameter. As a result, the autoloading of the library containing the template fails.

      The details are described in the forum

      One can reproduce this using attached code:

      rootcint -f dummyDict.cxx -inlineInputHeader -rmf dummyDict.rootmap -rml dummy.so -c -I./ dummy.h dummyLinkDef.h
      will prooduce the following rootmap (w/o the forward declaration of the template):

      cat dummyDict.rootmap
      { decls }
      namespace o2 { namespace tst {  } }
      namespace o2 { namespace tst { class foo; } }
       
      [ dummy.so ]
      # List of selected classes
      class o2::tst::bar<o2::tst::foo>
      class o2::tst::foo
      

      If you uncomment the line #pragma link C++ class o2::tst::bar<int>+; in the dummyLinkDef.h, then the rootmap will contain the template fwd. declaration:

      cat dummyDict.rootmap
      { decls }
      namespace o2 { namespace tst {  } }
      namespace o2 { namespace tst { template <typename T> class bar; } }
      namespace o2 { namespace tst { class foo; } }
       
      [ dummy.so ]
      # List of selected classes
      class o2::tst::bar<int>
      class o2::tst::bar<o2::tst::foo>
      class o2::tst::foo
      

        Attachments

          Activity

            People

            Assignee:
            axel Axel Naumann
            Reporter:
            shahoian Ruben Shahoyan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Actual End: