Bug 386407 - Incomplete type marked by semantic analysis in C++ code, but includes are correct and builds
Summary: Incomplete type marked by semantic analysis in C++ code, but includes are cor...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: 5.1.80
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-31 22:48 UTC by Sandro Knauß
Modified: 2017-11-15 19:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.2.0
Sentry Crash Report:


Attachments
Sementic Analysis of messagepart.cpp (329.22 KB, image/png)
2017-10-31 22:48 UTC, Sandro Knauß
Details
only some files are analyzed (301.28 KB, image/png)
2017-11-01 11:28 UTC, Sandro Knauß
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sandro Knauß 2017-10-31 22:48:32 UTC
Created attachment 108658 [details]
Sementic Analysis of messagepart.cpp

I try to scan kde/pim/messagelib for the semantic analysis - in detail mimetreeparser/src/messagepart.cpp compiles correctly with gcc/make, but the semantic analysis, tells me that MessagePart is incomplete in messagepart.cpp. But messagepart.h is as first imported with the complete class. The later import of objecttreeparser.h has correctly only a forward class declaration.
Comment 1 Sven Brauch 2017-11-01 01:08:22 UTC
More things look off here, apparently it doesn't find the Qt includes. Did you open the project with the CMake project manager ...?
Comment 2 Sandro Knauß 2017-11-01 11:25:43 UTC
I used project->Open/Import Project and selected the CMakeLists.txt.

Maybe also a good information: other files in the same project are correctly analyzed. The header file messagepart.h looks corrercly analized from the colors, but it complains about missing mimetreeparser/util.h, mimetreeparser/bodypartformatter.h, mimetreeparser_export.h.

The build directory is correct - this is the one I build the software successfully.

I use a neon docker container for kdevelop and building.

a funny side thing, in messagepart.cpp the include of mimetreeparser_debug.h is successfull but at an other file (nodehelper.cpp) in the same directory the analyzer complains about missing  mimetreeparser_debug.h.

the CMakeLists.txt part:
set(libmimetreeparser_SRCS
    messagepart.cpp
    nodehelper.cpp
    [...]
   )

add_library(KF5MimeTreeParser
    ${libmimetreeparser_SRCS}
    )

generate_export_header(KF5MimeTreeParser BASE_NAME mimetreeparser)
add_library(KF5::MimeTreeParser ALIAS KF5MimeTreeParser)

set(mimetreeparser_LINK_LIBRARIES
   )

target_link_libraries(KF5MimeTreeParser
    PRIVATE
    QGpgme
    KF5::Codecs
    KF5::I18n
    KF5::CoreAddons
    KF5::Mime
    Qt5::Gui
    )
Comment 3 Sandro Knauß 2017-11-01 11:28:59 UTC
Created attachment 108664 [details]
only some files are analyzed

In the screeshot you see an other day opening kdevelop. Interessting is that inside MessagePartPrivate the analyzier gets better results, but still includes are not handled correcly. But after the closing the namespace the analyzier stops completly.
Comment 4 Sandro Knauß 2017-11-15 18:08:53 UTC
With 5.2.0 the issue is fixed.
Comment 5 Sven Brauch 2017-11-15 19:10:51 UTC
Nice, thanks for the report. Probably was fixed by the work on adding the correct compiler flags from cmake.