Dictionary generation fails for partial template specialization

Dear ROOTers,
I am trying to generate dictionaries for a class which is a partial specialization of a more generic templated class.
This fails spectacularly and, after some investigation it seems because there are no forward declarations being generated for the partially specialized class.
To be more specific:

template<typename A, typename B, typename C, typename D>
class Tmpl{
public:
  A a;
  B b;
  C c;
  D d;
};

template<typename A>
using SpTmpl = Tmpl<A, int, int, int>;

using MyClass = SpTmpl<float>;

in the dictionary I can find definitions and references to both Tmpl and MyClass, but not SpTmpl. In particular, when I load the generated library in the interpreter, the compiler gives an error on the missing forward declaration for SpTmpl

dict dictionary forward declarations' payload:7:69: error: no template named 'SpTmpl'
using MyClass __attribute__((annotate("$clingAutoload$Tmpl.h")))  = SpTmpl<float>;
                                                                    ^

I attach a small reproducer.
repr.tar.gz (469 Bytes)

Cheers,
Valerio


ROOT Version: 6.20/00
Platform: CentOS 7
Compiler: gcc 7.3


Many thanks for the report and the reproducer! I created an issue.

1 Like

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