aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2012-12-18 01:29:20 +0000
committerAnders Carlsson <andersca@mac.com>2012-12-18 01:29:20 +0000
commit8a0086cfd21e5a89f96715d7a504178c5fc0ca26 (patch)
treed6fb77b043c9b01f6f3a5cbb32fc9ea5a0d9ef95 /test
parentadff43ad96defb28bad20d8335ab30beadd72ee8 (diff)
When warning about a missing prototype because a function declaration is missing 'void', insert a fixit to add the void.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170399 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Sema/warn-missing-prototypes.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/Sema/warn-missing-prototypes.c b/test/Sema/warn-missing-prototypes.c
index bfd1459b41..10018b6015 100644
--- a/test/Sema/warn-missing-prototypes.c
+++ b/test/Sema/warn-missing-prototypes.c
@@ -1,4 +1,5 @@
-// RUN: %clang -Wmissing-prototypes -fsyntax-only -Xclang -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -Wmissing-prototypes -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -Wmissing-prototypes -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
int f();
@@ -35,3 +36,8 @@ int f2(int x) { return x; }
// rdar://6759522
int main(void) { return 0; }
+
+void not_a_prototype_test(); // expected-note{{this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function}}
+void not_a_prototype_test() { } // expected-warning{{no previous prototype for function 'not_a_prototype_test'}}
+
+// CHECK: fix-it:"{{.*}}":{40:27-40:27}:"void"