This is an archive of the discontinued LLVM Phabricator instance.

[ASTImporter] Fix import of lambda in function param
ClosedPublic

Authored by martong on Jul 2 2019, 6:20 AM.

Details

Summary

The current import implementation fails to import the definition of a
lambda class if the lambda class is defined in a function param.
E.g., the lambda class below will be imported without any methods:

template <typename F>
void f(F L = [](){}) {}

Event Timeline

martong created this revision.Jul 2 2019, 6:20 AM
Herald added a reviewer: shafik. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript

Hello Gabor,
There is an inline question about tests; other code looks fine.

clang/lib/AST/ASTImporter.cpp
1713

Two spaces after 'the'.

clang/unittests/AST/ASTImporterTest.cpp
5103

Can we use std::distance instead?

martong marked 3 inline comments as done.Jul 3 2019, 6:28 AM

Thanks for the review Alexei!

clang/unittests/AST/ASTImporterTest.cpp
5103

Thanks! I've changed it.

martong updated this revision to Diff 207776.Jul 3 2019, 6:28 AM
martong marked an inline comment as done.
  • 'the ' -> 'the '
  • Use std::distance()
a_sidorin accepted this revision.Jul 7 2019, 2:56 PM
This revision is now accepted and ready to land.Jul 7 2019, 2:56 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2019, 5:49 AM