Browse Source

Fixed parser not to call GetPreviousDeclInContext if the declaration context has no previous declarations.

pull/86/head
triton 12 years ago
parent
commit
a2900fd254
  1. 3
      src/Parser/Parser.cpp

3
src/Parser/Parser.cpp

@ -314,6 +314,9 @@ static clang::SourceLocation GetDeclStartLocation(clang::CompilerInstance* C,
auto lineBeginOffset = SM.getFileOffset(lineBeginLoc); auto lineBeginOffset = SM.getFileOffset(lineBeginLoc);
assert(lineBeginOffset <= startOffset); assert(lineBeginOffset <= startOffset);
if (D->getLexicalDeclContext()->decls_empty())
return lineBeginLoc;
auto prevDecl = GetPreviousDeclInContext(D); auto prevDecl = GetPreviousDeclInContext(D);
if(!prevDecl) if(!prevDecl)
return lineBeginLoc; return lineBeginLoc;

Loading…
Cancel
Save