diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-01-17 03:11:34 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-01-17 03:11:34 +0000 |
commit | 4f59393f8c3dfe624b700c9efb271d65974eb3f2 (patch) | |
tree | b190abcdc5f2a1152136100391995cfaf98243af /lib/Parse/ParseCXXInlineMethods.cpp | |
parent | d5695297241d71a4aa38b32562a9d465027b007b (diff) |
PR18477: Create a function scope representing the constructor call when
handling C++11 default initializers. Without this, other parts of Sema (such as
lambda capture) would think the default initializer is part of the surrounding
function scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199453 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseCXXInlineMethods.cpp')
-rw-r--r-- | lib/Parse/ParseCXXInlineMethods.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp index feff7fb724..2fc705bc0f 100644 --- a/lib/Parse/ParseCXXInlineMethods.cpp +++ b/lib/Parse/ParseCXXInlineMethods.cpp @@ -528,10 +528,13 @@ void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) { SourceLocation EqualLoc; + Actions.ActOnStartCXXInClassMemberInitializer(); + ExprResult Init = ParseCXXMemberInitializer(MI.Field, /*IsFunction=*/false, EqualLoc); - Actions.ActOnCXXInClassMemberInitializer(MI.Field, EqualLoc, Init.release()); + Actions.ActOnFinishCXXInClassMemberInitializer(MI.Field, EqualLoc, + Init.release()); // The next token should be our artificial terminating EOF token. if (Tok.isNot(tok::eof)) { |