diff options
author | Gabor Marton <martongabesz@gmail.com> | 2019-02-15 12:04:05 +0000 |
---|---|---|
committer | Gabor Marton <martongabesz@gmail.com> | 2019-02-15 12:04:05 +0000 |
commit | 302f300a7a705e0bf27ee1987ec263b929ee92a5 (patch) | |
tree | 4b2b5c3235246ace7202493d6776ebbcae5a0915 /clang/unittests/AST/ASTImporterTest.cpp | |
parent | 0b53e8454b11340353610162191edb8eccd775cd (diff) | |
download | bcm5719-llvm-302f300a7a705e0bf27ee1987ec263b929ee92a5.tar.gz bcm5719-llvm-302f300a7a705e0bf27ee1987ec263b929ee92a5.zip |
[ASTImporter] Import every Decl in lambda record
Summary:
Previously only the fields were imported. Now every Decl is imported.
This way the destructor decl is not missing after import.
Patch by balazske (Balázs Kéri)
Reviewers: a.sidorin, shafik
Reviewed By: shafik
Subscribers: balazske, cfe-commits, Szelethus, martong, dkrupp
Tags: #clang
Differential Revision: https://reviews.llvm.org/D57740
llvm-svn: 354120
Diffstat (limited to 'clang/unittests/AST/ASTImporterTest.cpp')
-rw-r--r-- | clang/unittests/AST/ASTImporterTest.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/unittests/AST/ASTImporterTest.cpp b/clang/unittests/AST/ASTImporterTest.cpp index ece8e6e5bb7..6c929b4d561 100644 --- a/clang/unittests/AST/ASTImporterTest.cpp +++ b/clang/unittests/AST/ASTImporterTest.cpp @@ -2709,6 +2709,26 @@ TEST_P(ImportFunctions, ImportFunctionFromUnnamedNamespace) { 2u); } +TEST_P(ImportFunctions, ImportImplicitFunctionsInLambda) { + Decl *FromTU = getTuDecl( + R"( + void foo() { + (void)[]() { ; }; + } + )", + Lang_CXX11); + auto *FromD = FirstDeclMatcher<FunctionDecl>().match( + FromTU, functionDecl(hasName("foo"))); + auto *ToD = Import(FromD, Lang_CXX); + EXPECT_TRUE(ToD); + CXXRecordDecl *LambdaRec = + cast<LambdaExpr>(cast<CStyleCastExpr>( + *cast<CompoundStmt>(ToD->getBody())->body_begin()) + ->getSubExpr()) + ->getLambdaClass(); + EXPECT_TRUE(LambdaRec->getDestructor()); +} + struct ImportFriendFunctions : ImportFunctions {}; TEST_P(ImportFriendFunctions, ImportFriendFunctionRedeclChainProto) { |