aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaDecl.cpp2
-rw-r--r--clang/test/Sema/prototype-redecls.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 605e4bf..c3011c0 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -4042,7 +4042,7 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD, Scope *S,
// default argument promotion rules were already checked by
// ASTContext::typesAreCompatible().
if (Old->hasPrototype() && !New->hasWrittenPrototype() && NewDeclIsDefn &&
- Old->getNumParams() != New->getNumParams()) {
+ Old->getNumParams() != New->getNumParams() && !Old->isImplicit()) {
if (Old->hasInheritedPrototype())
Old = Old->getCanonicalDecl();
Diag(New->getLocation(), diag::err_conflicting_types) << New;
diff --git a/clang/test/Sema/prototype-redecls.c b/clang/test/Sema/prototype-redecls.c
index ed569b52..49305db 100644
--- a/clang/test/Sema/prototype-redecls.c
+++ b/clang/test/Sema/prototype-redecls.c
@@ -29,7 +29,7 @@ void garp(x) int x; {}
// Ensure redeclarations that conflict with a builtin use a note which makes it
// clear that the previous declaration was a builtin.
-float rintf() { // expected-error {{conflicting types for 'rintf'}} \
+float rintf() { // expected-warning {{incompatible redeclaration of library function 'rintf'}} \
expected-note {{'rintf' is a builtin with type 'float (float)'}}
return 1.0f;
}