I am currently in the process of moving a number of class files from our Visual Studio source environment into Qt Creator (version 3.4.2).
I have made several changes to cater for the differences in the compiler (into MinGW). One thing that is puzzling me is that the the IDE is reporting a specific error (red underline) but still compiles fine.
I am pretty sure the issue is isolated to using reinterpret_cast<T>
where T
is a global namespace.
For example, the following line will show as incorrect in the IDE but will still compile:
::GetWindowThreadProcessId(window, reinterpret_cast<::LPDWORD>(&processId));
The tooltip states:
expected ';' got ':'
If I change the code to remove ::
from LPDWORD
the syntax highlighting disappears. This will be fine in the IDE:
::GetWindowThreadProcessId(window, reinterpret_cast<LPDWORD>(&processId));
I suspect this is a bug in the IDE. Is this a safe assumption?
I don't plan on changing the code style for using the global namespace.
Thanks to lisyarus's comment, I was able to find that this is in fact a bug in QT Creator. There is already a bug report here.
As I mentioned in the question, the bug doesn't stop you from compiling the code. You can, if you wish, add a space between <
and ::
.