From 31d9254f7a09091996595a76d58cf487eda575b7 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Mon, 27 Jul 2009 22:25:19 +0000 Subject: [PATCH] Ensure we can work through typedefs. llvm-svn: 77265 --- clang/lib/AST/ASTContext.cpp | 4 ++-- clang/test/Sema/return.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 61dbf24..f7e1e3f 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1061,10 +1061,10 @@ QualType ASTContext::getNoReturnType(QualType T) { if (!T->isFunctionType()) assert(0 && "can't noreturn qualify non-pointer to function or block type"); - if (const FunctionNoProtoType *F = dyn_cast(T)) { + if (const FunctionNoProtoType *F = T->getAsFunctionNoProtoType()) { return getFunctionNoProtoType(F->getResultType(), true); } - const FunctionProtoType *F = cast(T); + const FunctionProtoType *F = T->getAsFunctionProtoType(); return getFunctionType(F->getResultType(), F->arg_type_begin(), F->getNumArgs(), F->isVariadic(), F->getTypeQuals(), F->hasExceptionSpec(), F->hasAnyExceptionSpec(), diff --git a/clang/test/Sema/return.c b/clang/test/Sema/return.c index c043379..423d1a9 100644 --- a/clang/test/Sema/return.c +++ b/clang/test/Sema/return.c @@ -205,3 +205,6 @@ int test30() { else _longjmp(test30_j, 1); } + +typedef void test31_t(int status); +void test31(test31_t *callback __attribute__((noreturn))); -- 2.7.4