Commit Graph

24 Commits

Author SHA1 Message Date
Richard Smith dda56e4b4a Support for C++11 (non-template) alias declarations.
llvm-svn: 129567
2011-04-15 14:24:37 +00:00
John McCall 388ef53234 Fix some corner cases in the __is_base_of logic.
llvm-svn: 124505
2011-01-28 22:02:36 +00:00
Anders Carlsson 7f95cd1817 Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.
llvm-svn: 120133
2010-11-24 23:12:57 +00:00
Anders Carlsson abb3b21b3b Fix typo.
llvm-svn: 120130
2010-11-24 22:55:29 +00:00
Anders Carlsson 4131f00a1f Add CXXRecordDecl::getIndirectPrimaryBases.
llvm-svn: 120129
2010-11-24 22:50:27 +00:00
Anders Carlsson 15722da2dc Add a short circuit in isVirtuallyDerivedFrom.
llvm-svn: 105457
2010-06-04 01:40:08 +00:00
Anders Carlsson a2f74f3c98 Add all final overriders to the map.
llvm-svn: 105374
2010-06-03 01:00:02 +00:00
Douglas Gregor 27ac429624 Use CanQualType to enforce the use of a canonical type argument to
CXXBasePaths::isAmbiguous(), rather than just asserting that we have a
canonical type. Fixes PR7176.

llvm-svn: 104374
2010-05-21 20:29:55 +00:00
Douglas Gregor 4165bd6772 Implement computation of the final overriders for each virtual
function within a class hierarchy (C++ [class.virtual]p2).

We use the final-overrider computation to determine when a particular
class is ill-formed because it has multiple final overriders for a
given virtual function (e.g., because two virtual functions override
the same virtual function in the same virtual base class). Fixes
PR5973.

We also use the final-overrider computation to determine which virtual
member functions are pure when determining whether a class is
abstract or diagnosing the improper use of an abstract class. The
prior approach to determining whether there were any pure virtual
functions in a class didn't cope with virtual base class subobjects
properly, and could not easily be fixed to deal with the oddities of
subobject hiding. Fixes PR6631.

llvm-svn: 99351
2010-03-23 23:47:56 +00:00
Douglas Gregor 3e637467d7 Implement name hiding for names found through virtual base subobjects
that are hidden by other derived base subobjects reached along a
lookup path that does *not* pass through the hiding subobject (C++
[class.member.lookup]p6). Fixes PR6462.

llvm-svn: 97640
2010-03-03 04:38:46 +00:00
Douglas Gregor 0555f7eefa Refactor CXXRecordDecl::lookupInBases() to push the recursion down a
level. No functionality change, and it obeys access control this
time.

llvm-svn: 97634
2010-03-03 02:18:00 +00:00
Douglas Gregor 77709906a4 Revert r97618. Access control sucks
llvm-svn: 97621
2010-03-03 01:13:25 +00:00
Douglas Gregor a62a5237fc Factor out the recursive lookup into C++ base classes into a separate,
static function. No functionality change.

llvm-svn: 97618
2010-03-03 01:02:31 +00:00
Douglas Gregor 0a5a2216e2 Eliminate the ASTContext parameter from RecordDecl::getDefinition()
and CXXRecordDecl::getDefinition(); it's totally unnecessary. No
functionality change.

llvm-svn: 95836
2010-02-11 01:04:33 +00:00
John McCall 6f891400c2 Reset the found-virtual-base state unless the *current* base produces a path,
not *any* base up to now has produced a path.  Fixes PR 6254.

I'll do the access-control part of this patch RSN.

llvm-svn: 95638
2010-02-09 00:57:12 +00:00
John McCall 553c0796ee Implement elementary access control.
llvm-svn: 94268
2010-01-23 00:46:32 +00:00
John McCall 401982f56c First pass at collecting access-specifier information along inheritance paths.
Triggers lots of assertions about missing access information;  fix them.

Will actually consume this information soon.

llvm-svn: 94038
2010-01-20 21:53:11 +00:00
Anders Carlsson f9812782b7 In CXXRecordDecl::forallBases, add the base to the "queue", so we walk more than one heirarchy of classes. John, please review.
llvm-svn: 90948
2009-12-09 04:26:02 +00:00
John McCall ddabf1a946 Add CXXRecordDecl::forallBases to walk an inheritance hierarchy with non-lookup
semantics and CXXRecordDecl::isProvablyNotDerivedFrom to assist with
pre-instantiation diagnostics.

llvm-svn: 90842
2009-12-08 07:42:38 +00:00
Douglas Gregor 1b8fe5b716 First part of changes to eliminate problems with cv-qualifiers and
sugared types. The basic problem is that our qualifier accessors
(getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at
the current QualType and not at any qualifiers that come from sugared
types, meaning that we won't see these qualifiers through, e.g.,
typedefs:

  typedef const int CInt;
  typedef CInt Self;

Self.isConstQualified() currently returns false!

Various bugs (e.g., PR5383) have cropped up all over the front end due
to such problems. I'm addressing this problem by splitting each
qualifier accessor into two versions: 

  - the "local" version only returns qualifiers on this particular
    QualType instance
  - the "normal" version that will eventually combine qualifiers from this
    QualType instance with the qualifiers on the canonical type to
    produce the full set of qualifiers.

This commit adds the local versions and switches a few callers from
the "normal" version (e.g., isConstQualified) over to the "local"
version (e.g., isLocalConstQualified) when that is the right thing to
do, e.g., because we're printing or serializing the qualifiers. Also,
switch a bunch of
  
  Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType()

expressions over to 

  Context.hasSameUnqualifiedType(T1, T2)

llvm-svn: 88969
2009-11-16 21:35:15 +00:00
John McCall 84c16cf824 Random const correctness, and incidentally use computeDeclContext when building
a using declaration.

llvm-svn: 86942
2009-11-12 03:15:40 +00:00
John McCall b692a098c6 Canonicality is a property of qualified types, not unqualified types.
llvm-svn: 84891
2009-10-22 20:10:53 +00:00
Mike Stump 512c5b770f Fix eof.
llvm-svn: 83433
2009-10-06 23:38:59 +00:00
Douglas Gregor 36d1b14dde Refactor the code that walks a C++ inheritance hierarchy, searching
for bases, members, overridden virtual methods, etc. The operations
isDerivedFrom and lookupInBases are now provided by CXXRecordDecl,
rather than by Sema, so that CodeGen and other clients can use them
directly.

llvm-svn: 83396
2009-10-06 17:59:45 +00:00