aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/warn-documentation.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-09-22 21:47:50 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-09-22 21:47:50 +0000
commit0bd9838751384181ff387f2fb346896792b89617 (patch)
tree4cd487eea2b5f4211d1a9cbe6c7210e71c3ff182 /test/Sema/warn-documentation.cpp
parent4bc38d69a2cf391555644900d78d074634973aa5 (diff)
Comment sema: warn when comment has \deprecated but declaration does not have a
deprecation attribute ('deprecated', 'availability' or 'unavailable'). This warning is under a separate flag, -Wdocumentation-deprecated-sync, so it can be turned off easily while leaving other -Wdocumentation warnings on. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/warn-documentation.cpp')
-rw-r--r--test/Sema/warn-documentation.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/test/Sema/warn-documentation.cpp b/test/Sema/warn-documentation.cpp
index 649f072ab9..b5d3300efd 100644
--- a/test/Sema/warn-documentation.cpp
+++ b/test/Sema/warn-documentation.cpp
@@ -380,14 +380,39 @@ using test_tparam15 = test_tparam13<T, int>;
/// Aaa
/// \deprecated Bbb
-void test_deprecated_1(int a);
+void test_deprecated_1(int a) __attribute__((deprecated));
// We don't want \deprecated to warn about empty paragraph. It is fine to use
// \deprecated by itself without explanations.
/// Aaa
/// \deprecated
-void test_deprecated_2(int a);
+void test_deprecated_2(int a) __attribute__((deprecated));
+
+/// Aaa
+/// \deprecated
+void test_deprecated_3(int a) __attribute__((availability(macosx,introduced=10.4)));
+
+/// Aaa
+/// \deprecated
+void test_deprecated_4(int a) __attribute__((unavailable));
+
+// expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+3 {{add a deprecation attribute to the declaration to silence this warning}}
+/// Aaa
+/// \deprecated
+void test_deprecated_5(int a);
+
+// expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+3 {{add a deprecation attribute to the declaration to silence this warning}}
+/// Aaa
+/// \deprecated
+void test_deprecated_6(int a) {
+}
+
+// expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
+/// Aaa
+/// \deprecated
+template<typename T>
+void test_deprecated_7(T aaa);
/// \invariant aaa