Consider the following source code:
#include <vector_types.h>
typedef int myint;
struct TestClass
{
template <typename T>
void Fun(float x)
{}
};
template <typename T>
void TestFun(float x)
{}
int main(int argc, char** argv)
{
TestClass tc;
tc.Fun<int>(3);
tc.Fun<int1>(3);
tc.Fun<myint>(3);
TestFun<int>(3);
TestFun<int1>(3);
TestFun<myint>(3);
return 0;
}
If this code is saved as a C++ (.cpp) file, all of the syntax highlighting works.
If this code is saved as a CUDA (.cu) file, only the expressions “tc.Fun(3)” and “TestFun(3)” have working syntax highlighting. Both the instantiation with the internal CUDA type “int1” and my own typedef’ed type “myint” are marked as red lines and the mousover text says
“Type ‘myint’ could not be resolved”.
This is strange, because pressing control and clicking on “myint” instantly jumps to the correct typedef.
Also note that this works just fine when the file is saved as a C++ file.
Operating System: Fedora 29
GCC: 8.2.1
CUDA: 10.1
Eclipse: 2018-09 (4.9)
Eclipse CDT: 9.5.3.201810041040