summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-08-05 19:03:35 +0000
committerDouglas Gregor <dgregor@apple.com>2009-08-05 19:03:35 +0000
commitf9bd4ecea23d0198f46996dce271a754f2a2ff64 (patch)
treec5671d65acb930bd3c9eedf891494c21dd60d154
parentd460cb43564ea511b8356f4f2bc817918206346e (diff)
downloadbcm5719-llvm-f9bd4ecea23d0198f46996dce271a754f2a2ff64.tar.gz
bcm5719-llvm-f9bd4ecea23d0198f46996dce271a754f2a2ff64.zip
Fix canonical type construction for function types with the noreturn
attribute. Fixes PR4865. llvm-svn: 78224
-rw-r--r--clang/lib/AST/ASTContext.cpp3
-rw-r--r--clang/test/Sema/attr-noreturn.c8
2 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index ad46bcdca7e..404593452c2 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 2970a4827ef..f649b91d9cf 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
OpenPOWER on IntegriCloud