diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-08-05 05:36:45 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-08-05 05:36:45 +0000 |
commit | 50d62d1b4a98adbc83de8f8cd1379ea1c25656f7 (patch) | |
tree | acbdf51eb2a3ea3b6b4a7db47c97e97233d83b55 /lib/Sema/SemaDecl.cpp | |
parent | 4ed459851eef142f2059af7ae487484e8a14fc67 (diff) |
Introduce the canonical type smart pointers, and use them in a few places to
tighten up the static type system.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78164 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index a21502961a..44ee2ebbf0 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1553,21 +1553,21 @@ DeclarationName Sema::GetNameForDeclarator(Declarator &D) { case Declarator::DK_Constructor: { QualType Ty = QualType::getFromOpaquePtr(D.getDeclaratorIdType()); - Ty = Context.getCanonicalType(Ty); - return Context.DeclarationNames.getCXXConstructorName(Ty); + return Context.DeclarationNames.getCXXConstructorName( + Context.getCanonicalType(Ty)); } case Declarator::DK_Destructor: { QualType Ty = QualType::getFromOpaquePtr(D.getDeclaratorIdType()); - Ty = Context.getCanonicalType(Ty); - return Context.DeclarationNames.getCXXDestructorName(Ty); + return Context.DeclarationNames.getCXXDestructorName( + Context.getCanonicalType(Ty)); } case Declarator::DK_Conversion: { // FIXME: We'd like to keep the non-canonical type for diagnostics! QualType Ty = QualType::getFromOpaquePtr(D.getDeclaratorIdType()); - Ty = Context.getCanonicalType(Ty); - return Context.DeclarationNames.getCXXConversionFunctionName(Ty); + return Context.DeclarationNames.getCXXConversionFunctionName( + Context.getCanonicalType(Ty)); } case Declarator::DK_Operator: @@ -2736,9 +2736,9 @@ void Sema::CheckFunctionDeclaration(FunctionDecl *NewFD, NamedDecl *&PrevDecl, CXXRecordDecl *Record = cast<CXXRecordDecl>(NewFD->getParent()); QualType ClassType = Context.getTypeDeclType(Record); if (!ClassType->isDependentType()) { - ClassType = Context.getCanonicalType(ClassType); DeclarationName Name - = Context.DeclarationNames.getCXXDestructorName(ClassType); + = Context.DeclarationNames.getCXXDestructorName( + Context.getCanonicalType(ClassType)); if (NewFD->getDeclName() != Name) { Diag(NewFD->getLocation(), diag::err_destructor_name); return NewFD->setInvalidDecl(); |