]> granicus.if.org Git - clang/commitdiff
Adding some additional test cases for the cleanup attribute.
authorAaron Ballman <aaron@aaronballman.com>
Wed, 11 Sep 2013 13:43:47 +0000 (13:43 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Wed, 11 Sep 2013 13:43:47 +0000 (13:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190525 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/attr-cleanup.cpp

index 3ac8e817dc9e36ee33268e278799df4e7f3731ad..b6c58533acf2b1be1713dced48929c579d427483 100644 (file)
@@ -4,7 +4,18 @@ namespace N {
   void c1(int *a) {}\r
 }\r
 \r
+class C {\r
+  static void c2(int *a) {}  // expected-note {{implicitly declared private here}} expected-note {{implicitly declared private here}}\r
+};\r
+\r
 void t1() {\r
   int v1 __attribute__((cleanup(N::c1)));\r
   int v2 __attribute__((cleanup(N::c2)));  // expected-error {{no member named 'c2' in namespace 'N'}}\r
+  int v3 __attribute__((cleanup(C::c2)));  // expected-error {{'c2' is a private member of 'C'}}\r
 }\r
+\r
+class D : public C {\r
+  void t2() {\r
+    int v1 __attribute__((cleanup(c2)));  // expected-error {{'c2' is a private member of 'C'}}\r
+  }\r
+};\r