aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Misc/warning-flags.c
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-06-06 17:25:21 +0000
committerJordan Rose <jordan_rose@apple.com>2012-06-06 17:25:21 +0000
commitccf43ca05cb1540f3d95a73b7b329bf926808c7b (patch)
treef1c81126e272ce660655dd437fa5dbf9d058f303 /clang/test/Misc/warning-flags.c
parentfaa389462835ab40ed8af86eb32c44abfcf4e48a (diff)
downloadllvm-ccf43ca05cb1540f3d95a73b7b329bf926808c7b.zip
llvm-ccf43ca05cb1540f3d95a73b7b329bf926808c7b.tar.gz
llvm-ccf43ca05cb1540f3d95a73b7b329bf926808c7b.tar.bz2
Add pedantic warning -Wempty-translation-unit (C11 6.9p1).
In standard C since C89, a 'translation-unit' is syntactically defined to have at least one "external-declaration", which is either a decl or a function definition. In Clang the latter gives us a declaration as well. The tricky bit about this warning is that our predefines can contain external declarations (__builtin_va_list and the 128-bit integer types). Therefore our AST parser now makes sure we have at least one declaration that doesn't come from the predefines buffer. Also, remove bogus warning about empty source files. This doesn't catch source files that only contain comments, and never fired anyway because of our predefines. PR12665 and <rdar://problem/9165548> llvm-svn: 158085
Diffstat (limited to 'clang/test/Misc/warning-flags.c')
-rw-r--r--clang/test/Misc/warning-flags.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/test/Misc/warning-flags.c b/clang/test/Misc/warning-flags.c
index 98130c5..cdfb38f 100644
--- a/clang/test/Misc/warning-flags.c
+++ b/clang/test/Misc/warning-flags.c
@@ -17,7 +17,7 @@ This test serves two purposes:
The list of warnings below should NEVER grow. It should gradually shrink to 0.
-CHECK: Warnings without flags (242):
+CHECK: Warnings without flags (241):
CHECK-NEXT: ext_anonymous_struct_union_qualified
CHECK-NEXT: ext_binary_literal
CHECK-NEXT: ext_cast_fn_obj
@@ -26,7 +26,6 @@ CHECK-NEXT: ext_designated_init
CHECK-NEXT: ext_duplicate_declspec
CHECK-NEXT: ext_ellipsis_exception_spec
CHECK-NEXT: ext_empty_fnmacro_arg
-CHECK-NEXT: ext_empty_source_file
CHECK-NEXT: ext_enum_friend
CHECK-NEXT: ext_enum_value_not_int
CHECK-NEXT: ext_enumerator_list_comma