| Summary: | implementing method of template class creates invalid code | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Keith Rusler <xzekecomax> |
| Component: | Language Support: CPP (Clang-based) | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | amhndu, l.jirkovsky |
| Priority: | NOR | ||
| Version First Reported In: | git master | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Keith Rusler
2010-12-01 03:55:46 UTC
please add the test-code so we don't have to reinvent it // START CODE
class Test
{
template <typename T>
void someFuction(T arg);
};
// END CODE
Steps to reproduce:
1. Write Test (or a part of it) and request code completion.
2. Select Implement void someFuction(T arg) …
Expected result:
template <typename T>
void Test::someFuction(T arg)
{
}
Result you get:
void Test::someFuction(T arg)
{
}
The same goes for class templates. Request implementation of someFunction with the following code:
// CODE
template <typename T>
class Test
{
void someFuction(T arg);
};
// END CODE
Expected result:
// CODE
template<typename T>
void Test< T >::someFuction(T arg)
{
}
// CODE END
Result you get:
// CODE
void Test< T >::someFuction(T arg)
{
}
// CODE END
still valid in the clang backend, there we get:
template<T> void Test<T>::someFuction(T arg)
{
}
note the missing "typename" in the `template<T>` part
|