Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
None
-
Qt Creator 15.0.0
-
None
Description
In a CPP file the 'clangd' based line annotations have one type which shows an include directive to not be needed because it is "not used directly". With the suggestion to remove it.
This annotation is, however, wrong for the case where the included class declaration is actually wrapped in a smart pointer.
To avoid confusing descriptions, here is the gcc error when I remove the include for BroadcastTxData.
SyncSPVAction.cpp:137:50: error: invalid use of incomplete type ‘using std::__shared_ptr_access<BroadcastTxData, __gnu_cxx::_S_atomic, false, false>::element_type = class BroadcastTxData’
{aka ‘class BroadcastTxData’}137 | if (tx && segmentId == tx->privSegment()) {
A line above that 137 we find:
auto tx = weakTx.lock();
It would be nice if creator could avoid showing suggestions to remove includes based on shared pointers using the class.