diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-10-10 14:49:18 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-10-10 14:49:18 +0000 |
commit | 147545d698972cfd34ece30a5d55e8180784161e (patch) | |
tree | 596d4b9451a02b67059816484b580445591c37f8 /lib/Parse/ParseCXXInlineMethods.cpp | |
parent | 25aaff9cf8a66bc236e5ccaf6183d11c14674cd3 (diff) |
Parse the initializer for a class member after handling its
declarator, so that the declarator is in scope for the
initializer. Fixes PR9989.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseCXXInlineMethods.cpp')
-rw-r--r-- | lib/Parse/ParseCXXInlineMethods.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp index 40e36f0a0b..ef7ad91cbc 100644 --- a/lib/Parse/ParseCXXInlineMethods.cpp +++ b/lib/Parse/ParseCXXInlineMethods.cpp @@ -35,15 +35,22 @@ Decl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS, ParsingDeclarator &D, Decl *FnD; if (D.getDeclSpec().isFriendSpecified()) - // FIXME: Friend templates FnD = Actions.ActOnFriendFunctionDecl(getCurScope(), D, true, move(TemplateParams)); - else { // FIXME: pass template information through + else { FnD = Actions.ActOnCXXMemberDeclarator(getCurScope(), AS, D, move(TemplateParams), 0, - VS, Init.release(), - /*HasInit=*/false, + VS, /*HasInit=*/false, /*IsDefinition*/true); + if (FnD) { + bool TypeSpecContainsAuto + = D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_auto; + if (Init.get()) + Actions.AddInitializerToDecl(FnD, Init.get(), false, + TypeSpecContainsAuto); + else + Actions.ActOnUninitializedDecl(FnD, TypeSpecContainsAuto); + } } HandleMemberFunctionDefaultArgs(D, FnD); |