Method who have definitions in structs/classes are semantically inline.

Per the FIXME, it might be interesting to track whether the inline keyword
was also used on the method, but for now we don't do this.  Testcase pending.

llvm-svn: 71589
This commit is contained in:
Chris Lattner 2009-05-12 20:55:07 +00:00
parent faec4fd030
commit da7a0977d6
1 changed files with 7 additions and 0 deletions

View File

@ -2067,6 +2067,13 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
}
// This is a C++ method declaration.
// FIXME: All inline method declarations are semantically inline. We
// should add a new bit to keep track of whether they were declared with an
// inline keyword as well.
if (CurContext == DC && IsFunctionDefinition)
isInline = true;
NewFD = CXXMethodDecl::Create(Context, cast<CXXRecordDecl>(DC),
D.getIdentifierLoc(), Name, R,
(SC == FunctionDecl::Static), isInline);