After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 709526 - C++ parsing problem with operators <<, <, >, >> inside templates
C++ parsing problem with operators <<, <, >, >> inside templates
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.8.5
Other All
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2013-10-06 20:04 UTC by Vincent
Modified: 2013-12-24 18:59 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vincent 2013-10-06 20:04:49 UTC
Here is an example of a problem with the parsing of C++ default template parameters that implies operators <<, <, > and >>:

----------------------------------------------------------------
#include <iostream>
#include <type_traits>

template <class Type, class = typename std::enable_if<!std::is_void<decltype(std::declval<std::ostream&>()<<std::declval<Type>())>::value>::type>
bool print(std::ostream& stream, const Type& value)
{
    return stream<<value;
}

int main(int argc, char* argv[])
{
    print(std::cout, 42);
    return 0;
}
----------------------------------------------------------------

It seems that these operators are interpreted as template delimiters causing a parsing problem.
Comment 1 Dimitri van Heesch 2013-10-12 21:02:57 UTC
Confirmed. Should be fixed in the next GIT update.
Comment 2 Dimitri van Heesch 2013-12-24 18:59:54 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.6. Please verify if this is indeed the case. Reopen the
bug if you think it is not fixed and please include any additional information 
that you think can be relevant (preferrably in the form of a self-contained example).