]> granicus.if.org Git - clang/commitdiff
Ensure we can work through typedefs.
authorMike Stump <mrs@apple.com>
Mon, 27 Jul 2009 22:25:19 +0000 (22:25 +0000)
committerMike Stump <mrs@apple.com>
Mon, 27 Jul 2009 22:25:19 +0000 (22:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77265 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp
test/Sema/return.c

index 61dbf24b4563e72d33132d2cf15c57ef1beb676f..f7e1e3fdffd3bf76ce911b7f7c78f6af2ae5efa6 100644 (file)
@@ -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<FunctionNoProtoType>(T)) {
+  if (const FunctionNoProtoType *F = T->getAsFunctionNoProtoType()) {
     return getFunctionNoProtoType(F->getResultType(), true);
   }
-  const FunctionProtoType *F = cast<FunctionProtoType>(T);
+  const FunctionProtoType *F = T->getAsFunctionProtoType();
   return getFunctionType(F->getResultType(), F->arg_type_begin(),
                          F->getNumArgs(), F->isVariadic(), F->getTypeQuals(),
                          F->hasExceptionSpec(), F->hasAnyExceptionSpec(),
index c04337924ad24bb75ff331a99dc2725e58de2ebc..423d1a9902959eeef7eda6495ee152236535428a 100644 (file)
@@ -205,3 +205,6 @@ int test30() {
   else
     _longjmp(test30_j, 1);
 }
+
+typedef void test31_t(int status);
+void test31(test31_t *callback __attribute__((noreturn)));