r190525 - Adding some additional test cases for the cleanup attribute.

Aaron Ballman aaron at aaronballman.com
Wed Sep 11 06:43:47 PDT 2013


Author: aaronballman
Date: Wed Sep 11 08:43:47 2013
New Revision: 190525

URL: http://llvm.org/viewvc/llvm-project?rev=190525&view=rev
Log:
Adding some additional test cases for the cleanup attribute.

Modified:
    cfe/trunk/test/SemaCXX/attr-cleanup.cpp

Modified: cfe/trunk/test/SemaCXX/attr-cleanup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-cleanup.cpp?rev=190525&r1=190524&r2=190525&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/attr-cleanup.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-cleanup.cpp Wed Sep 11 08:43:47 2013
@@ -4,7 +4,18 @@ namespace N {
   void c1(int *a) {}
 }
 
+class C {
+  static void c2(int *a) {}  // expected-note {{implicitly declared private here}} expected-note {{implicitly declared private here}}
+};
+
 void t1() {
   int v1 __attribute__((cleanup(N::c1)));
   int v2 __attribute__((cleanup(N::c2)));  // expected-error {{no member named 'c2' in namespace 'N'}}
+  int v3 __attribute__((cleanup(C::c2)));  // expected-error {{'c2' is a private member of 'C'}}
 }
+
+class D : public C {
+  void t2() {
+    int v1 __attribute__((cleanup(c2)));  // expected-error {{'c2' is a private member of 'C'}}
+  }
+};





More information about the cfe-commits mailing list