diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-03-26 06:57:13 +0000 | 
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-03-26 06:57:13 +0000 | 
| commit | f956b35f98910fd26a2fe62a34f62d885b904c0d (patch) | |
| tree | ba098ed1335565df609dea97b6447e2b960b29a8 /clang | |
| parent | aaf8acfea1d436b747170f4871c3e48e5879422f (diff) | |
| download | bcm5719-llvm-f956b35f98910fd26a2fe62a34f62d885b904c0d.tar.gz bcm5719-llvm-f956b35f98910fd26a2fe62a34f62d885b904c0d.zip  | |
Do not mark the destructor of a function parameter's type. Fixes PR6709.
llvm-svn: 99615
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 4 | ||||
| -rw-r--r-- | clang/test/CXX/class.access/p4.cpp | 4 | ||||
| -rw-r--r-- | clang/test/SemaCXX/destructor.cpp | 5 | 
3 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 46aedfcb288..f2520fc5eb7 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -2254,10 +2254,6 @@ bool Sema::CheckParmsForFunctionDef(FunctionDecl *FD) {          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; diff --git a/clang/test/CXX/class.access/p4.cpp b/clang/test/CXX/class.access/p4.cpp index 07ecc6caf0a..4da9eef25dd 100644 --- a/clang/test/CXX/class.access/p4.cpp +++ b/clang/test/CXX/class.access/p4.cpp @@ -101,14 +101,14 @@ namespace test2 {  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}}    } diff --git a/clang/test/SemaCXX/destructor.cpp b/clang/test/SemaCXX/destructor.cpp index 7010d2e0d09..ae3dc86e97f 100644 --- a/clang/test/SemaCXX/destructor.cpp +++ b/clang/test/SemaCXX/destructor.cpp @@ -78,3 +78,8 @@ namespace PR6421 {      }    };  } + +namespace PR6709 { +  template<class T> class X { T v; ~X() { ++*v; } }; +  void a(X<int> x) {} +}  | 

