diff --git a/clang/lib/AST/Interp/InterpFrame.cpp b/clang/lib/AST/Interp/InterpFrame.cpp index b06923114c7a24..d460d7ea3710a8 100644 --- a/clang/lib/AST/Interp/InterpFrame.cpp +++ b/clang/lib/AST/Interp/InterpFrame.cpp @@ -228,7 +228,7 @@ Pointer InterpFrame::getParamPointer(unsigned Off) { SourceInfo InterpFrame::getSource(CodePtr PC) const { // Implicitly created functions don't have any code we could point at, // so return the call site. - if (Func && Func->getDecl()->isImplicit() && Caller) + if (Func && (!Func->hasBody() || Func->getDecl()->isImplicit()) && Caller) return Caller->getSource(RetPC); return S.getSource(Func, PC); @@ -243,7 +243,7 @@ SourceLocation InterpFrame::getLocation(CodePtr PC) const { } SourceRange InterpFrame::getRange(CodePtr PC) const { - if (Func && Func->getDecl()->isImplicit() && Caller) + if (Func && (!Func->hasBody() || Func->getDecl()->isImplicit()) && Caller) return Caller->getRange(RetPC); return S.getRange(Func, PC);