[Bug?]Namespace and pointer to inner struct/class
Hi,
I'm having problem where CLion is unable to resolve pointer to an inner struct within a namespace. Here's my case:
VERSION 3.2)
project(HelloCLion)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(HelloCLion ${SOURCE_FILES} MyClass.cpp MyClass.h)
namespace MyNameSpace {
class MyClass {
struct MyInnerStruct {
};
private:
void doSomething(MyInnerStruct in);
};
}"MyClass.h"
using namespace MyNameSpace;
void MyClass::doSomething(MyInnerStruct in) {
}
In this case, everything works fine. If I change parameter in to a pointervoid doSomething(MyInnerStruct in); tovoid doSomething(MyInnerStruct *in);
It says "Can't resolve 'MyInnerStruct'" in doSomething() implementation in MyClass.cpp. But if I remove all the namespace things together and press "Reload CMake Project", there'll be no complains at all, either in being a pointer or not. Despite of that, the code compiles just fine.
Can someone please tell me what's wrong with it?
请先登录再写评论。
Hi Huy.
It correctly works for me.
Could you please attach a sample project and also please specify which CLion version are you using.
Hi Anna,
The version is 1.0.5 on Mac OSX Yosemite, build #CL-141.875. I have tested on a Ubuntu 12.04.5 Virtual Machine, too. It gives the same error.
Attachment(s):
HelloCLion.zip
Apparently, it is fixed in the newest version 1.1. So nevermind.
Thank you, Anna.