[cfe-dev] CXXRecordDecl::isDerivedFrom and public inheritance

Douglas Gregor dgregor at apple.com
Tue May 3 10:03:12 PDT 2011


On May 3, 2011, at 10:02 AM, Konstantin Tokarev wrote:

> 
> 
> 03.05.2011, 19:07, "Douglas Gregor" <dgregor at apple.com>:
>> On May 3, 2011, at 6:11 AM, Konstantin Tokarev wrote:
>> 
>>>  Hi all,
>>> 
>>>  Method CXXRecordDecl::isDerivedFrom allows to determine if some CXXRecordDecl
>>>  is derived from another, but does not take into account if inheritance is public, private,
>>>  or protected.
>>> 
>>>  Is there any way to determine if inheritance is public on all steps between base and
>>>  derived classes?
>> 
>> One of the forms of isDerivedFrom() returns the base path that one follows to get to the base class. Sema's CheckBaseClassAccess knows how to check the accessibility of that base class using the base path.
> 
> How do I get QualType from CXXRecordDecl*?

ASTContext::getTypeDeclType().

> BTW, I see that CheckBaseClassAccess uses CXXRecordDecl* internally. Will patch with similar method operating on CXXRecordDecl* arguments be welcomed?

Only if there is some benefit to Clang. I, personally, can't think of such a benefit.

	- Doug



More information about the cfe-dev mailing list