diff --git a/src/Parser/Parser.cpp b/src/Parser/Parser.cpp index 85b438b2..2d428e5e 100644 --- a/src/Parser/Parser.cpp +++ b/src/Parser/Parser.cpp @@ -314,6 +314,9 @@ static clang::SourceLocation GetDeclStartLocation(clang::CompilerInstance* C, auto lineBeginOffset = SM.getFileOffset(lineBeginLoc); assert(lineBeginOffset <= startOffset); + if (D->getLexicalDeclContext()->decls_empty()) + return lineBeginLoc; + auto prevDecl = GetPreviousDeclInContext(D); if(!prevDecl) return lineBeginLoc;