Bug 285100 - KDevelop does know the "template < typename = SomeType >" construct
Summary: KDevelop does know the "template < typename = SomeType >" construct
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 4.2.2
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-27 15:03 UTC by Cyrille Berger
Modified: 2016-03-24 13:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cyrille Berger 2011-10-27 15:03:27 UTC
Version:           4.2.2 (using KDE 4.6.5) 
OS:                Linux

Apparently, in template definition, typename does not have to be followed by an identifier.

The following construct is legal c++:

template < typename = int >

In reality it is mostly useful to do the following

template < typename = std::enable_if< SomeTest >::type >
void foo()
{
}

And depending on the result of SomeTest the function is generated or not. Well anyway, if you input the above function (or similar) in kdevelop, kdevelop underlight in red the "=" (and the template keyword too). While it should not.




Reproducible: Always

Steps to Reproduce:
To reproduce, in a cpp file, paste the following:


#include <utility>

template < typename = std::enable_if< false >::type >
void foo()
{
}

int main(int argc, char** argv)
{
  
  foo();
}


Actual Results:  
the equal in "typename =", the template keyword and the last ">" are wrongly underlight in red.

Expected Results:  
Nothing is underlighted.
Comment 1 Kevin Funk 2016-03-24 13:40:28 UTC
Works for me in KDevelop 5, using the Clang backend.