class Test { public: class Test2* data; // hover over Test2 shows class as Test::Test2 (unresolved forward-declaration) }; class Test2 // hover over Test2 shows class as Test2 { public: int integer; }; int main(int,char**) { Test t; t.data = new Test2; // hover over Test2 shows class as Test::Test2 (unresolved forward-declaration) return t.data->integer; } Reproducible: Always Steps to Reproduce: 1. Paste code into editor 2. hover over Test2 in class definition of Test 3. hover over Test2 in main function Actual Results: Step 2: class is shown as Test::Test2 (unresolved forward-declaration) Step 3: class is shown as Test::Test2 (unresolved forward-declaration) Expected Results: Step 2: class is shown as Test2 or ::Test2 (unresolved forward-declaration) Step 3: class is shown as Test2 or ::Test2 and can be resolved
I have now looked this up in the (draft) C++ Standard N3797. The section 3.4.4 paragraph 3 gives a very obvious example: struct Node { struct Node* Next; // OK: Refers to Node at global scope struct Data* Data; // OK: Declares type Data // at global scope and member Data };
Ups. Sorry failed to format it correctly I have now looked this up in the (draft) C++ Standard N3797. The section 3.4.4 paragraph 3 gives a very obvious example: struct Node { struct Node* Next; // OK: Refers to Node at global scope struct Data* Data; // OK: Declares type Data // at global scope and member Data }; This is the same for the keyword class. Can anybody mark this as CONFIMED please.
Created attachment 119557 [details] patch for kdevelop/plugins/clang/duchain/builder.cpp fix inline class declaration context