diff options
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 0d9918f6e43..cb0e5fb2181 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -2638,8 +2638,9 @@ bool Sema::CheckParmsForFunctionDef(FunctionDecl *FD) { } } - if (getLangOptions().AccessControl) - CheckDestructorAccess(Param->getLocation(), Param->getType()); + if (getLangOptions().CPlusPlus) + if (const RecordType *RT = Param->getType()->getAs<RecordType>()) + FinalizeVarWithDestructor(Param, RT); } return HasInvalidParm; |