diff options
| author | Steve Naroff <snaroff@apple.com> | 2007-08-28 20:14:24 +0000 |
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2007-08-28 20:14:24 +0000 |
| commit | f93b6726b1512b7550ea81fae9ada56e394231da (patch) | |
| tree | 038c8c90ab0a5105c2895303f01592874b4bbdd8 /clang/Sema/SemaType.cpp | |
| parent | eda180e23975e07ea4ba3b1db0f1182f36b17618 (diff) | |
| download | bcm5719-llvm-f93b6726b1512b7550ea81fae9ada56e394231da.tar.gz bcm5719-llvm-f93b6726b1512b7550ea81fae9ada56e394231da.zip | |
Finish converting decls over to the new invalid decl API.
Also removed an old FIXME (FIXME: "auto func();" passes through...).
llvm-svn: 41555
Diffstat (limited to 'clang/Sema/SemaType.cpp')
| -rw-r--r-- | clang/Sema/SemaType.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/clang/Sema/SemaType.cpp b/clang/Sema/SemaType.cpp index 04264a3e514..3bc0e760ba9 100644 --- a/clang/Sema/SemaType.cpp +++ b/clang/Sema/SemaType.cpp @@ -278,11 +278,12 @@ Sema::TypeResult Sema::ParseTypeName(Scope *S, Declarator &D) { assert(D.getIdentifier() == 0 && "Type name should have no identifier!"); QualType T = GetTypeForDeclarator(D, S); + + assert(!T.isNull() && "GetTypeForDeclarator() returned null type"); - // If the type of the declarator was invalid, this is an invalid typename. - if (T.isNull()) - return true; - + // In this context, we *do not* check D.getInvalidType(). If the declarator + // type was invalid, GetTypeForDeclarator() still returns a "valid" type, + // though it will not reflect the user specified type. return T.getAsOpaquePtr(); } @@ -292,9 +293,10 @@ Sema::TypeResult Sema::ParseParamDeclaratorType(Scope *S, Declarator &D) { // just want the type converted. QualType T = GetTypeForDeclarator(D, S); - // If the type of the declarator was invalid, this is an invalid typename. - if (T.isNull()) - return true; - + assert(!T.isNull() && "GetTypeForDeclarator() returned null type"); + + // In this context, we *do not* check D.getInvalidType(). If the declarator + // type was invalid, GetTypeForDeclarator() still returns a "valid" type, + // though it will not reflect the user specified type. return T.getAsOpaquePtr(); } |

