As I can see, this is a common problem when analyzing method definitions within a structure and is not specific to code completion. In any case, in this case, special processing in the parser, which you can find in the file ParseCXXInlineMethods.cpp .
In a Parser::ParseCXXInlineMethodDef() comment:
/// ParseCXXInlineMethodDef - We parsed and verified that the specified /// Declarator is a well formed C++ inline method definition. Now lex its body /// and store its tokens for parsing after the C++ class is complete. Parser::DeclPtrTy Parser::ParseCXXInlineMethodDef(...
And later, the code for parsing method definitions:
Thus, lexers created for function bodies are analyzed only after the rest of the class has been analyzed.
source share