diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-02-17 03:23:10 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-02-17 03:23:10 +0000 |
commit | a908e7fcccf038abcb665be9192a71a7ec0b8394 (patch) | |
tree | 38a3e4a3d813860f8f57242fd4b102607a9c5873 /clang/test/Sema/implicit-builtin-redecl.c | |
parent | b317efdf818b7cbbb5fb3f707d2c7113a26c182a (diff) | |
download | bcm5719-llvm-a908e7fcccf038abcb665be9192a71a7ec0b8394.tar.gz bcm5719-llvm-a908e7fcccf038abcb665be9192a71a7ec0b8394.zip |
Static variables and functions won't collide with standard library
functions, so if we're declaring a static we should implicitly declare
a library function by the same name (e.g., malloc, strdup). Fixes PR3592.
llvm-svn: 64736
Diffstat (limited to 'clang/test/Sema/implicit-builtin-redecl.c')
-rw-r--r-- | clang/test/Sema/implicit-builtin-redecl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Sema/implicit-builtin-redecl.c b/clang/test/Sema/implicit-builtin-redecl.c new file mode 100644 index 00000000000..837f79f4ef6 --- /dev/null +++ b/clang/test/Sema/implicit-builtin-redecl.c @@ -0,0 +1,7 @@ +// RUN: clang -fsyntax-only -verify %s + +// PR3592 +static void* malloc(int); +static void* malloc(int size) { + return ((void*)0); /*do not use heap in this file*/ +} |