diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-16 19:58:32 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-16 19:58:32 +0000 |
| commit | 1778f4bf6d26b613de89eabb18a5b186d22cfafa (patch) | |
| tree | 10226f4cfaf8c803c149fffd9e10d41a7f70cb81 /clang/lib/AST/ASTContext.cpp | |
| parent | 5244f34e75dfe5e73fb43a332cb030b29fc1dd0c (diff) | |
| download | bcm5719-llvm-1778f4bf6d26b613de89eabb18a5b186d22cfafa.tar.gz bcm5719-llvm-1778f4bf6d26b613de89eabb18a5b186d22cfafa.zip | |
Don't ICE on user redeclaration of objc's built-in types.
Issue diagnostics instead if types do not match.
llvm-svn: 62349
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index fe868d07683..8e7410c47c7 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -2012,9 +2012,13 @@ void ASTContext::setObjCIdType(TypedefDecl *TD) // typedef struct objc_object *id; const PointerType *ptr = TD->getUnderlyingType()->getAsPointerType(); - assert(ptr && "'id' incorrectly typed"); + // User error - caller will issue diagnostics. + if (!ptr) + return; const RecordType *rec = ptr->getPointeeType()->getAsStructureType(); - assert(rec && "'id' incorrectly typed"); + // User error - caller will issue diagnostics. + if (!rec) + return; IdStructType = rec; } @@ -2024,9 +2028,11 @@ void ASTContext::setObjCSelType(TypedefDecl *TD) // typedef struct objc_selector *SEL; const PointerType *ptr = TD->getUnderlyingType()->getAsPointerType(); - assert(ptr && "'SEL' incorrectly typed"); + if (!ptr) + return; const RecordType *rec = ptr->getPointeeType()->getAsStructureType(); - assert(rec && "'SEL' incorrectly typed"); + if (!rec) + return; SelStructType = rec; } |

