summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-16 18:20:44 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-16 18:20:44 +0000
commitbcbf86399f16fcf02b278cf43a1aa83b522a9de3 (patch)
tree4d9490ca9af14fa9e682969d865aeaa5e07cbc39 /clang/test
parenta1c37501ed195d1e03b9871a09bdcf9d9a0559e5 (diff)
downloadbcm5719-llvm-bcbf86399f16fcf02b278cf43a1aa83b522a9de3.tar.gz
bcm5719-llvm-bcbf86399f16fcf02b278cf43a1aa83b522a9de3.zip
When a function with a prototype is redeclared without a prototype,
merge the prototype into the redeclaration (and make a note in the declaration). Fixes PR3588. llvm-svn: 64641
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/function-redecl.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/test/Sema/function-redecl.c b/clang/test/Sema/function-redecl.c
new file mode 100644
index 00000000000..85663396cf3
--- /dev/null
+++ b/clang/test/Sema/function-redecl.c
@@ -0,0 +1,30 @@
+// RUN: clang -fsyntax-only -verify %s
+
+// PR3588
+void g0(int, int);
+void g0(); // expected-note{{previous declaration is here}}
+
+void f0() {
+ g0(1, 2, 3); // expected-error{{too many arguments to function call}}
+}
+
+void g0(int); // expected-error{{conflicting types for 'g0'}}
+
+int g1(int, int);
+
+typedef int INT;
+
+INT g1(x, y)
+ int x;
+ int y;
+{
+ return x + y;
+}
+
+int g2(int, int); // expected-note{{previous declaration is here}}
+
+INT g2(x) // expected-error{{conflicting types for 'g2'}}
+ int x;
+{
+ return x;
+}
OpenPOWER on IntegriCloud