[cfe-commits] r99615 - in /cfe/trunk: lib/Sema/SemaChecking.cpp test/CXX/class.access/p4.cpp test/SemaCXX/destructor.cpp

Douglas Gregor dgregor at apple.com
Thu Mar 25 23:57:13 PDT 2010


Author: dgregor
Date: Fri Mar 26 01:57:13 2010
New Revision: 99615

URL: http://llvm.org/viewvc/llvm-project?rev=99615&view=rev
Log:
Do not mark the destructor of a function parameter's type. Fixes PR6709.

Modified:
    cfe/trunk/lib/Sema/SemaChecking.cpp
    cfe/trunk/test/CXX/class.access/p4.cpp
    cfe/trunk/test/SemaCXX/destructor.cpp

Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=99615&r1=99614&r2=99615&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Fri Mar 26 01:57:13 2010
@@ -2254,10 +2254,6 @@
         Diag(Param->getLocation(), diag::err_array_star_in_function_definition);
       }
     }
-
-    if (getLangOptions().CPlusPlus)
-      if (const RecordType *RT = Param->getType()->getAs<RecordType>())
-        FinalizeVarWithDestructor(Param, RT);
   }
 
   return HasInvalidParm;

Modified: cfe/trunk/test/CXX/class.access/p4.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/class.access/p4.cpp?rev=99615&r1=99614&r2=99615&view=diff
==============================================================================
--- cfe/trunk/test/CXX/class.access/p4.cpp (original)
+++ cfe/trunk/test/CXX/class.access/p4.cpp Fri Mar 26 01:57:13 2010
@@ -101,14 +101,14 @@
 namespace test3 {
   class A {
   private:
-    ~A(); // expected-note 3 {{declared private here}}
+    ~A(); // expected-note 2 {{declared private here}}
     static A foo;
   };
 
   A a; // expected-error {{variable of type 'test3::A' has private destructor}}
   A A::foo;
 
-  void foo(A param) { // expected-error {{variable of type 'test3::A' has private destructor}}
+  void foo(A param) { // okay
     A local; // expected-error {{variable of type 'test3::A' has private destructor}}
   }
 

Modified: cfe/trunk/test/SemaCXX/destructor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/destructor.cpp?rev=99615&r1=99614&r2=99615&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/destructor.cpp (original)
+++ cfe/trunk/test/SemaCXX/destructor.cpp Fri Mar 26 01:57:13 2010
@@ -78,3 +78,8 @@
     }
   };
 }
+
+namespace PR6709 {
+  template<class T> class X { T v; ~X() { ++*v; } };
+  void a(X<int> x) {}
+}





More information about the cfe-commits mailing list