Add -Wdeprecated-declarations to driver and add a test case.
authorSteve Naroff <snaroff@apple.com>
Tue, 31 Mar 2009 17:28:26 +0000 (17:28 +0000)
committerSteve Naroff <snaroff@apple.com>
Tue, 31 Mar 2009 17:28:26 +0000 (17:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68117 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Options.def
test/Sema/surpress-deprecated.c [new file with mode: 0644]

index 11668bb590832181045b174167f03c081574455f..19a10c0b0ba70f17860a137cadc61077c495daf9 100644 (file)
@@ -268,6 +268,7 @@ OPTION("-Wall", Wall, Flag, clang_ignored_W_Group, INVALID, "", 0)
 OPTION("-Wcast-align", Wcast_align, Flag, clang_ignored_W_Group, INVALID, "", 0)
 OPTION("-Wchar-align", Wchar_align, Flag, clang_ignored_W_Group, INVALID, "", 0)
 OPTION("-Wchar-subscripts", Wchar_subscripts, Flag, clang_ignored_W_Group, INVALID, "", 0)
+OPTION("-Wdeprecated-declarations", Wdeprecated_declarations, Flag, clang_W_Group, INVALID, "", 0)
 OPTION("-Werror", Werror, Flag, clang_ignored_W_Group, INVALID, "", 0)
 OPTION("-Wextra", Wextra, Flag, clang_ignored_W_Group, INVALID, "", 0)
 OPTION("-Wfloat-equal", Wfloat_equal, Flag, clang_W_Group, INVALID, "", 0)
@@ -279,6 +280,7 @@ OPTION("-Wmissing-braces", Wmissing_braces, Flag, clang_ignored_W_Group, INVALID
 OPTION("-Wmissing-prototypes", Wmissing_prototypes, Flag, clang_W_Group, INVALID, "", 0)
 OPTION("-Wmost", Wmost, Flag, clang_ignored_W_Group, INVALID, "", 0)
 OPTION("-Wnested-externs", Wnested_externs, Flag, clang_ignored_W_Group, INVALID, "", 0)
+OPTION("-Wno-deprecated-declarations", Wno_deprecated_declarations, Flag, clang_W_Group, INVALID, "", 0)
 OPTION("-Wno-format-nonliteral", Wno_format_nonliteral, Flag, clang_W_Group, INVALID, "", 0)
 OPTION("-Wno-format-y2k", Wno_format_y2k, Flag, clang_ignored_W_Group, INVALID, "", 0)
 OPTION("-Wno-four-char-constants", Wno_four_char_constants, Flag, clang_ignored_W_Group, INVALID, "", 0)
diff --git a/test/Sema/surpress-deprecated.c b/test/Sema/surpress-deprecated.c
new file mode 100644 (file)
index 0000000..8dbe9dd
--- /dev/null
@@ -0,0 +1,7 @@
+// RUN: clang -fsyntax-only -Wno-deprecated-declarations -verify %s
+extern void OldFunction() __attribute__((deprecated));
+
+int main (int argc, const char * argv[]) {
+  OldFunction();
+}
+