From f9bd4ecea23d0198f46996dce271a754f2a2ff64 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 5 Aug 2009 19:03:35 +0000 Subject: [PATCH] Fix canonical type construction for function types with the noreturn attribute. Fixes PR4865. llvm-svn: 78224 --- clang/lib/AST/ASTContext.cpp | 3 ++- clang/test/Sema/attr-noreturn.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index ad46bcdca7e4..404593452c23 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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/clang/test/Sema/attr-noreturn.c b/clang/test/Sema/attr-noreturn.c index 2970a4827ef9..f649b91d9cf1 100644 --- a/clang/test/Sema/attr-noreturn.c +++ b/clang/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