Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
Qt Creator 4.11.1, Qt Creator 4.12.0-beta2
-
None
-
(1) QtCreator 4.11.1 on Arch Linux (Kernel 5.5.9)
(2) QtCreator 4.12.0-beta2 on Windows 10 (x64)
Description
Hi folks,
I'm facing a strange problem with the clang code model and the reporting/highlighting of diagnostic issues. I was searching the internet and this bug tracker for this issue but I haven't found anything...
Good case: When I'm writing bad C++ code in a *.cpp file, the semantic issue is shown as line annotation and it is shown in the Issues pane at the bottom where all warnings and errors are displayed.
Bad case: When I'm writing bad C++ code in *.h(pp) file, the semantic issue is neither shown as line annotation nor it is displayed in the issues pane. However, there is a yellow triangle at the corresponding line number which reports the semantic issue when hovering over it.
Code example
Here's a minimal example using Foo.h and Foo.cpp.
// Foo.h #pragma once class Foo { public: void bar(int foo) {} void baz(int foo); };
// Foo.cpp #include "Foo.h" void Foo::baz(int foo) { // do nothing with foo }
Diagnostic Configuration
Tools --> Options --> C++ --> Code Model --> Diagnostic Configuration --> Manage
-Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-global-constructors -Wno-old-style-cast -Wno-weak-vtables -Wno-switch-enum
The option Use diagnostic flags from build system is disabled.
Annotations
Tools --> Options --> Text Editor --> Display:
- Line annotations are enabled
- The option Next to editor content is selected
Output
Everything works fine for the *.cpp.
For the *.h(pp) the behavior is different.
Attachments
Issue Links
- duplicates
-
QTCREATORBUG-23783 Follow symbol under cursor mismatch functions in different subprojects
- Closed