]> granicus.if.org Git - clang/commitdiff
Fix canonical type construction for function types with the noreturn
authorDouglas Gregor <dgregor@apple.com>
Wed, 5 Aug 2009 19:03:35 +0000 (19:03 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 5 Aug 2009 19:03:35 +0000 (19:03 +0000)
attribute. Fixes PR4865.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78224 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp
test/Sema/attr-noreturn.c

index ad46bcdca7e49ea44ddc2241d3f530bc2f6e79af..404593452c231dec973bab72dddb26cfb4982c78 100644 (file)
@@ -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 =
index 2970a4827ef94e217ff7730dae7d1705d9863d54..f649b91d9cf1e8d26f80434a9cb06dea704402c6 100644 (file)
@@ -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