Errors on template with unsigned char


I'm testing CLion, and I'm having troubles with errors check. I wrote some simple code to have a simple exemple:

#include <iostream>
#include <cstring>

class Table
    Table(unsigned int size)
        _tab = new char[size];
        memset(_tab, 0, size);

        delete [] _tab;

    template <typename T>
    T &at(unsigned int i)
        T *t = static_cast<T *>(static_cast<void *>(_tab));
        return t[i];

    char *_tab;

typedef unsigned char myuchar;

int main() {
    Table tab(256);
    for (unsigned int i = 0; i < 256; ++i) {<unsigned char>(i) = static_cast<unsigned char>(i);
    for (unsigned int i = 0; i < 256; ++i) {
        std::cout << static_cast<int>(<myuchar>(i)) << std::endl;
    return 0;

The problem here is that CLion reports an error on<unsigned char>(i) saying that it is expecting a '(' in the template. If I typedef unsigned char as I did a few lines under, the error isn't here anymore (using<myuchar>(i))
Of course this code compiles with no warning, and works as expected.

Am I doing something wrong or is it a problem with CLion's error check?

Please sign in to leave a comment.