I guess you are using this “snippet” in “.c” file, isn’t it?
Actually, .c files are assumed to be compiled by the C compiler, so the indexer warns about syntax error…
Using the same snippet in a .h or .cpp file doesn’t cause any syntax error.
From there, it’s true that this snippet doesn’t cause any compilation error, but please can you tell what’s the use of it in a .c file?
This snippet comes from a header (.h) file, not a source file.
If the indexer is assuming that the file is to be compiled with the C compiler rather than the C++ compiler (which would be correct in this case, as the header in #included from a .c file), then it shouldn’t be defining the __cplusplus macro. If the macro wasn’t defined, then the offending code would be ignored.
Correct, we have a bug in defined symbols detection: __cplusplus is defined in C (impacts only the indexer behavior)
Logged for fix in next release
Thanks for your feedback