breathe icon indicating copy to clipboard operation
breathe copied to clipboard

Spurious "Error in type declaration"

Open pitrou opened this issue 5 years ago • 4 comments

Given the following C++ declarations:

template <typename TypeClass>
class NumericArray;

class Date64Type;
using Date64Array = NumericArray<Date64Type>;

(note the Date64Type and NumericArray classes are documented in other headers)

and the following directives:

.. doxygenclass:: arrow::NumericArray
   :members:

.. doxygentypedef:: arrow::Date64Array

I get the following error:

/home/antoine/arrow/docs/source/cpp/api/array.rst:72:Error in type declaration.
If typedef-like declaration:
  Type must be either just a name or a typedef-like declaration.
  If just a name:
    Invalid definition: Expected end of definition. [error at 19]
      arrow::Date64Array = typedef NumericArray<Date64Type>
      -------------------^
  If typedef-like declaration:
    Error in declarator or parameters and qualifiers
    If pointer to member declarator:
      Invalid definition: Expected identifier in nested name. [error at 19]
        arrow::Date64Array = typedef NumericArray<Date64Type>
        -------------------^
    If declarator-id:
      Invalid definition: Expected identifier in nested name. [error at 19]
        arrow::Date64Array = typedef NumericArray<Date64Type>
        -------------------^
If type alias or template alias:
  Invalid definition: Expected identifier in nested name, got keyword: typedef [error at 28]
    arrow::Date64Array = typedef NumericArray<Date64Type>
    ----------------------------^

pitrou avatar Dec 11 '18 11:12 pitrou

That typedef should not be in the declaration string given to Sphinx. Perhaps the same issue as in #316?

jakobandersen avatar Dec 11 '18 13:12 jakobandersen

Yes, it seems like this might by the same issue (though #316 is quite vague as to which warnings are emitted).

pitrou avatar Dec 11 '18 13:12 pitrou

Fyi, I just closed #316, assuming it is resolved. As noted above it was a tad vague, this one is not. It is likely Breathe still mangles the declaration. Leaving this open.

vermeeren avatar Aug 27 '19 13:08 vermeeren

This might be fixed with #512, released in Breathe v4.17.0. Note that you also need Sphinx 3.x for recent Breathe versions. Could someone try and post results?

vermeeren avatar May 01 '20 19:05 vermeeren