Skip to content

Commit aac21a1

Browse files
committed
Implement a routine to check if a function was deleted.
1 parent 088ba34 commit aac21a1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

include/clang/Interpreter/CppInterOp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ namespace Cpp {
226226
/// void N::f(int i, double d, long l = 0, char ch = 'a').
227227
std::string GetFunctionSignature(TCppFunction_t func);
228228

229+
/// Returns if a function was marked as \c =delete.
230+
bool IsFunctionDeleted(TCppConstFunction_t function);
231+
229232
bool IsTemplatedFunction(TCppFunction_t func);
230233

231234
bool ExistsFunctionTemplate(TCppSema_t sema, const std::string &name,

lib/Interpreter/CppInterOp.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,11 @@ namespace Cpp {
809809
}
810810
}
811811

812+
bool IsFunctionDeleted(TCppConstFunction_t function) {
813+
auto *FD = cast<const FunctionDecl>((const clang::Decl*)function);
814+
return FD->isDeleted();
815+
}
816+
812817
bool IsTemplatedFunction(TCppFunction_t func)
813818
{
814819
auto *D = (Decl *) func;

0 commit comments

Comments
 (0)