summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaLookup.cpp8
-rw-r--r--clang/test/Sema/implicit-builtin-decl.c9
2 files changed, 9 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index 0f5a78b10a1..01220769e32 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -545,14 +545,6 @@ static bool LookupBuiltin(Sema &S, LookupResult &R) {
R.addDecl(D);
return true;
}
-
- if (R.isForRedeclaration()) {
- // If we're redeclaring this function anyway, forget that
- // this was a builtin at all.
- S.Context.BuiltinInfo.ForgetBuiltin(BuiltinID, S.Context.Idents);
- }
-
- return false;
}
}
}
diff --git a/clang/test/Sema/implicit-builtin-decl.c b/clang/test/Sema/implicit-builtin-decl.c
index d7ec16953a0..2a7a7ca27b6 100644
--- a/clang/test/Sema/implicit-builtin-decl.c
+++ b/clang/test/Sema/implicit-builtin-decl.c
@@ -1,4 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: not %clang_cc1 -fsyntax-only -ast-dump %s | FileCheck %s
+
void f() {
int *ptr = malloc(sizeof(int) * 10); // expected-warning{{implicitly declaring library function 'malloc' with type}} \
// expected-note{{please include the header <stdlib.h> or explicitly provide a declaration for 'malloc'}} \
@@ -57,3 +59,10 @@ void snprintf() { }
void longjmp(); // expected-warning{{declaration of built-in function 'longjmp' requires inclusion of the header <setjmp.h>}}
extern float fmaxf(float, float);
+
+struct __jmp_buf_tag {};
+void sigsetjmp(struct __jmp_buf_tag[1], int); // expected-warning{{declaration of built-in function 'sigsetjmp' requires inclusion of the header <setjmp.h>}}
+
+// CHECK: FunctionDecl {{.*}} <line:[[@LINE-2]]:1, col:44> sigsetjmp '
+// CHECK-NOT: FunctionDecl
+// CHECK: ReturnsTwiceAttr {{.*}} <{{.*}}> Implicit
OpenPOWER on IntegriCloud