[cfe-commits] r64957 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/Sema/implicit-builtin-redecl.c

Douglas Gregor dgregor at apple.com
Wed Feb 18 14:00:46 PST 2009


Author: dgregor
Date: Wed Feb 18 16:00:45 2009
New Revision: 64957

URL: http://llvm.org/viewvc/llvm-project?rev=64957&view=rev
Log:
Return true on errors, return true on errors, return true on errors

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/test/Sema/implicit-builtin-redecl.c

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=64957&r1=64956&r2=64957&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Feb 18 16:00:45 2009
@@ -660,7 +660,7 @@
       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;

Modified: cfe/trunk/test/Sema/implicit-builtin-redecl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/implicit-builtin-redecl.c?rev=64957&r1=64956&r2=64957&view=diff

==============================================================================
--- cfe/trunk/test/Sema/implicit-builtin-redecl.c (original)
+++ cfe/trunk/test/Sema/implicit-builtin-redecl.c Wed Feb 18 16:00:45 2009
@@ -5,3 +5,10 @@
 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}}
+}





More information about the cfe-commits mailing list