aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
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
commit0afeaa3ff83d88c52bf785825d6bab8848f44772 (patch)
tree2b4fbc73d493b6df256f0421e288948e657ac02c /lib/Sema/SemaDecl.cpp
parent3eb67ca786ef75bad43d30349c7334b921ba0dbc (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71589 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index c778ca6c29..d8b6f45e37 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/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);