Return true on errors, return true on errors, return true on errors

llvm-svn: 64957
This commit is contained in:
Douglas Gregor 2009-02-18 22:00:45 +00:00
parent 1045289881
commit 222e5e4ad2
2 changed files with 8 additions and 1 deletions

View File

@ -660,7 +660,7 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
Diag(New->getLocation(), diag::warn_redecl_library_builtin) << New;
Diag(Old->getLocation(), diag::note_previous_builtin_declaration)
<< Old << Old->getType();
return false;
return true;
}
PrevDiag = diag::note_previous_builtin_declaration;

View File

@ -5,3 +5,10 @@ static void* malloc(int);
static void* malloc(int size) {
return ((void*)0); /*do not use heap in this file*/
}
void *calloc(int, int, int); // expected-warning{{incompatible redeclaration of library function 'calloc' will be ignored}} \
// expected-note{{'calloc' is a builtin with type 'void *(unsigned long, unsigned long)'}}
void f1(void) {
return calloc(0, 0, 0); // expected-error{{too many arguments to function call}}
}