aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r--lib/Sema/SemaChecking.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 0d9918f6e4..cb0e5fb218 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/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;