summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/attr-deprecated.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-10-22 23:36:17 +0000
committerJohn McCall <rjmccall@apple.com>2010-10-22 23:36:17 +0000
commit811a0f5578e3898f53724e234b66e9969ddb5aad (patch)
tree97c22a0ccebaaad9aa9dae871735bd96d41c1ab0 /clang/test/SemaCXX/attr-deprecated.cpp
parent21836f726b34c3f1050a812f1562557e6bbe38f8 (diff)
downloadbcm5719-llvm-811a0f5578e3898f53724e234b66e9969ddb5aad.tar.gz
bcm5719-llvm-811a0f5578e3898f53724e234b66e9969ddb5aad.zip
Parse attributes on enumerators and instantiate attributes on enum decls.
llvm-svn: 117182
Diffstat (limited to 'clang/test/SemaCXX/attr-deprecated.cpp')
-rw-r--r--clang/test/SemaCXX/attr-deprecated.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/attr-deprecated.cpp b/clang/test/SemaCXX/attr-deprecated.cpp
index 2164f9dd17f..fe7c833d322 100644
--- a/clang/test/SemaCXX/attr-deprecated.cpp
+++ b/clang/test/SemaCXX/attr-deprecated.cpp
@@ -190,3 +190,46 @@ namespace test5 {
{}
};
}
+
+// rdar://problem/8518751
+namespace test6 {
+ enum __attribute__((deprecated)) A {
+ a0
+ };
+ void testA() {
+ A x; // expected-warning {{'A' is deprecated}}
+ x = a0;
+ }
+
+ enum B {
+ b0 __attribute__((deprecated)),
+ b1
+ };
+ void testB() {
+ B x;
+ x = b0; // expected-warning {{'b0' is deprecated}}
+ x = b1;
+ }
+
+ template <class T> struct C {
+ enum __attribute__((deprecated)) Enum {
+ c0
+ };
+ };
+ void testC() {
+ C<int>::Enum x; // expected-warning {{'Enum' is deprecated}}
+ x = C<int>::c0;
+ }
+
+ template <class T> struct D {
+ enum Enum {
+ d0,
+ d1 __attribute__((deprecated)),
+ };
+ };
+ void testD() {
+ D<int>::Enum x;
+ x = D<int>::d0;
+ x = D<int>::d1; // expected-warning {{'d1' is deprecated}}
+ }
+}
OpenPOWER on IntegriCloud