Bug 358520

Summary: Completion offers to implement std::set<QByteArray> * qgpu_features(const QString&)
Product: [Applications] kdevelop Reporter: David Faure <faure>
Component: Language Support: CPP (Clang-based)Assignee: kdevelop-bugs-null
Status: CONFIRMED ---    
Severity: normal CC: kfunk
Priority: LO    
Version First Reported In: 4.90.91   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description David Faure 2016-01-25 07:34:56 UTC
At the top of kio/autotests/clipboardupdatertest.cpp (probably doesn't matter), type 

class FooPrivate
{
    void foo();
};
then request completion, it will offer
* implement std::set<QByteArray> * qgpu_features(const QString&)  (WTF?)
* implement void FooPrivate::foo() [as expected]

Reproducible: Always



Expected Results:  
it shouldn't offer me to implement random stuff from Qt.
Comment 1 Kevin Funk 2016-12-12 23:53:35 UTC
Still the case, interesting.
Comment 2 Kevin Funk 2016-12-12 23:55:31 UTC
Coming from QTEST_MAIN macro, fwiw:

#define QTEST_MAIN(TestObject) \
QT_BEGIN_NAMESPACE \
QTEST_ADD_GPU_BLACKLIST_SUPPORT_DEFS \
  ...

#ifndef QT_NO_OPENGL
#  define QTEST_ADD_GPU_BLACKLIST_SUPPORT_DEFS \
    extern Q_TESTLIB_EXPORT std::set<QByteArray> *(*qgpu_features_ptr)(const QString &); \
    extern Q_GUI_EXPORT std::set<QByteArray> *qgpu_features(const QString &);
  ...
Comment 3 Kevin Funk 2016-12-12 23:57:43 UTC
Reducing priority a bit.

Difficult to handle: the declaration (but not definition) of that function indeed happens inside the .cpp, so the suggestion is not necessarily wrong.