[cfe-commits] r78224 - in /cfe/trunk: lib/AST/ASTContext.cpp test/Sema/attr-noreturn.c
Douglas Gregor
dgregor at apple.com
Wed Aug 5 12:03:39 PDT 2009
Author: dgregor
Date: Wed Aug 5 14:03:35 2009
New Revision: 78224
URL: http://llvm.org/viewvc/llvm-project?rev=78224&view=rev
Log:
Fix canonical type construction for function types with the noreturn
attribute. Fixes PR4865.
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
cfe/trunk/test/Sema/attr-noreturn.c
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=78224&r1=78223&r2=78224&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Wed Aug 5 14:03:35 2009
@@ -1616,7 +1616,8 @@
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 =
Modified: cfe/trunk/test/Sema/attr-noreturn.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-noreturn.c?rev=78224&r1=78223&r2=78224&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-noreturn.c (original)
+++ cfe/trunk/test/Sema/attr-noreturn.c Wed Aug 5 14:03:35 2009
@@ -25,3 +25,11 @@
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
More information about the cfe-commits
mailing list