summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseCXXInlineMethods.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-10-10 14:49:18 +0000
committerDouglas Gregor <dgregor@apple.com>2011-10-10 14:49:18 +0000
commit728d00b8e70e732b80fa2f533424c70f9dd7dd99 (patch)
tree2282e328500cfadc4673e1c2125dd9c23d0dd8ba /clang/lib/Parse/ParseCXXInlineMethods.cpp
parent877d4ebba49cc6b68cf8606d8192e2c23a2df4d7 (diff)
downloadbcm5719-llvm-728d00b8e70e732b80fa2f533424c70f9dd7dd99.tar.gz
bcm5719-llvm-728d00b8e70e732b80fa2f533424c70f9dd7dd99.zip
Parse the initializer for a class member after handling its
declarator, so that the declarator is in scope for the initializer. Fixes PR9989. llvm-svn: 141539
Diffstat (limited to 'clang/lib/Parse/ParseCXXInlineMethods.cpp')
-rw-r--r--clang/lib/Parse/ParseCXXInlineMethods.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp
index 40e36f0a0b1..ef7ad91cbc5 100644
--- a/clang/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud