diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-21 19:11:17 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-21 19:11:17 +0000 |
commit | 680e9e018d9f4be8d87f661760afec91fdabb556 (patch) | |
tree | 7e843fa74bef0fc36f434a2c5a864282648534e2 /clang/lib/Serialization/ASTWriter.cpp | |
parent | 4930dd6841d147f7aea4964c0a74213e714bc048 (diff) | |
download | bcm5719-llvm-680e9e018d9f4be8d87f661760afec91fdabb556.tar.gz bcm5719-llvm-680e9e018d9f4be8d87f661760afec91fdabb556.zip |
Improve our handling of lambda expressions that occur within default
arguments. There are two aspects to this:
- Make sure that when marking the declarations referenced in a
default argument, we don't try to mark local variables, both because
it's a waste of time and because the semantics are wrong: we're not
in a place where we could capture these variables again even if it
did make sense.
- When a lambda expression occurs in a default argument of a
function template, make sure that the corresponding closure type is
considered dependent, so that it will get properly instantiated. The
second bit is a bit of a hack; to fix it properly, we may have to
rearchitect our handling of default arguments, parsing them only
after creating the function definition. However, I'd like to
separate that work from the lambdas work.
llvm-svn: 151076
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 5c3a1e93f69..8dbd6e44715 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -4330,6 +4330,7 @@ void ASTWriter::AddCXXDefinitionData(const CXXRecordDecl *D, RecordDataImpl &Rec // Add lambda-specific data. if (Data.IsLambda) { CXXRecordDecl::LambdaDefinitionData &Lambda = D->getLambdaData(); + Record.push_back(Lambda.Dependent); Record.push_back(Lambda.NumCaptures); Record.push_back(Lambda.NumExplicitCaptures); Record.push_back(Lambda.ManglingNumber); |