C++ code inspection issues

Answered

I'm considering purchasing AppCode, but code inspection shows me errors even when the code compiles successfully.

Errors are mostly related to templates: Cannot resolve, Duplicate declarations (while they are not because of SFINAE). Also, I had Array issues (Subscripted value is not an array, while it implements [] operator), Incompatible types (while they are convertible or even aliases for the same type).

I understand fixing the inspection isn't an easy task, so I'd like to know if there is a way to make AppCode highlight actual compilation errors at the moment?

I couldn't reproduce all the errors from the big project in a small example, the correct code below has 3:

#include <type_traits>

template <class T> typename std::enable_if<std::is_integral<T>::value, void>::type f(T& value) {}
template <class T> typename std::enable_if<!std::is_integral<T>::value, void>::type f(T& value) {}

struct A {
A(int) {}
};

template <class T = A>
struct B : public T {
using T::T;
};

int main() {
B<> b(1);
char c = 2["abc"];
return 0;
}
0
1 comment
Official comment

Hi!

Sorry for inconvenience, all bugs you mentioned are known. Unfortunately there's no good way to avoid them until they will be fixed. Feel free to upvote and leave your comments there.

https://youtrack.jetbrains.com/issue/CPP-6277

https://youtrack.jetbrains.com/issue/CPP-2807

https://youtrack.jetbrains.com/issue/CPP-2370

Please sign in to leave a comment.