the noreturn attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77253
91177308-0d34-0410-b5e6-
96231b3b80d8
}
Proto += ")";
+ if (D->hasAttr<NoReturnAttr>())
+ Proto += " __attribute((noreturn))";
if (CXXConstructorDecl *CDecl = dyn_cast<CXXConstructorDecl>(D)) {
if (CDecl->getNumBaseOrMemberInitializers() > 0) {
Proto += " : ";
if (!FD->getAttr<FormatAttr>())
FD->addAttr(::new (Context) FormatAttr("printf", 2,
Name->isStr("vasprintf") ? 0 : 3));
- }
+ } else if (Name->isStr("longjmp") &&
+ !FD->hasAttr<NoReturnAttr>())
+ FD->addAttr(::new (Context) NoReturnAttr());
}
TypedefDecl *Sema::ParseTypedefDecl(Scope *S, Declarator &D, QualType T) {
int test29() {
exit(1);
}
+
+#include <setjmp.h>
+jmp_buf test30_j;
+int test30() {
+ longjmp(test30_j, 1);
+}