summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-05-12 20:55:07 +0000
committerChris Lattner <sabre@nondot.org>2009-05-12 20:55:07 +0000
commitda7a0977d69019395ecd65b8c4847566751f7d25 (patch)
treea75b32eae3aaefca20208977b62d993c4655c1ed /clang
parentfaec4fd0300717da7354ca1c0e4432b04ae998d4 (diff)
downloadbcm5719-llvm-da7a0977d69019395ecd65b8c4847566751f7d25.tar.gz
bcm5719-llvm-da7a0977d69019395ecd65b8c4847566751f7d25.zip
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
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index c778ca6c292..d8b6f45e37a 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -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);
OpenPOWER on IntegriCloud