Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] AST: How to discover when ICPPClassType is C-structure or when it is true class?

Good day!

CDT AST confuses ICompositeType with ICPPClassType for structures in C++ programs:
Foe example, I have the following "C" program:

struct tst {
	int a;
	int b;
};

int main()
{
	return 0;
}

I get IASTName for "tst", then IBinding for it, and it is instanceof ICompositeType in this case. That's OK. But when I create "C++" program with the same content, IBinding is instanceof ICPPClassType!
Then, how to distinguish these types:

struct tst {
	int a;
	int b;
};

and

class tst {
	int a;
	int b;
};

???

Thanks for any help.

Best regards,
              Andrey.


Back to the top