Program received signal SIGSEGV, Segmentation fault.
clang::TypeSourceInfo::getType (this=0x0) at /usr/local/include/clang/AST/Decl.h:66
66 QualType getType() const { return Ty; }
"In the attached testcase, clang will attempt to instantiate the friend decl which is invalid because
Derived has not been declared."
I think that maybe this is my problem, I mean, that the friend decl is invalid because it has not been declared. But, how can I avoid the launch of this signal? I cannot prevent the appearance of this situation and I don’t want the program to terminate.
I hope you can help me with this. Thanks in advance.
Program received signal SIGSEGV, Segmentation fault.
clang::TypeSourceInfo::getType (this=0x0) at
/usr/local/include/clang/AST/Decl.h:66
66 QualType getType() const { return Ty; }
"In the attached testcase, clang will attempt to instantiate the friend decl which is invalid because
Derived has not been declared."
I think that maybe this is my problem,
No, it's not. You're calling 'getFriendType()' on a FriendDecl that
represents a friend function, not a friend type, so it returns nullptr. You
then try to call 'getType()' on a null pointer.
Ok, thank you Richard for your answer. Now I understand what a friendType is. Two friendDecl, but only the marked bold is a FriendType:
friend class A;
friend void a();