From: Douglas Gregor Date: Wed, 5 Aug 2009 19:03:35 +0000 (+0000) Subject: Fix canonical type construction for function types with the noreturn X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47259d9ca7840dd66f06f5f11da7768b23d1e0fd;p=clang Fix canonical type construction for function types with the noreturn attribute. Fixes PR4865. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78224 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index ad46bcdca7..404593452c 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -1616,7 +1616,8 @@ QualType ASTContext::getFunctionType(QualType ResultTy,const QualType *ArgArray, Canonical = getFunctionType(getCanonicalType(ResultTy), CanonicalArgs.data(), NumArgs, - isVariadic, TypeQuals, NoReturn); + isVariadic, TypeQuals, false, + false, 0, 0, NoReturn); // Get the new insert position for the node we care about. FunctionProtoType *NewIP = diff --git a/test/Sema/attr-noreturn.c b/test/Sema/attr-noreturn.c index 2970a4827e..f649b91d9c 100644 --- a/test/Sema/attr-noreturn.c +++ b/test/Sema/attr-noreturn.c @@ -25,3 +25,11 @@ void f4() { return; // expected-warning {{function 'f4' declared 'noreturn' should not return}} } +// PR4685 +extern void f5 (unsigned long) __attribute__ ((__noreturn__)); + +void +f5 (unsigned long size) +{ + +} \ No newline at end of file