]> granicus.if.org Git - clang/commit
[clang] fixing -ast-print for variadic parameter pack in lambda capture
authorNicolas Lesser <blitzrakete@gmail.com>
Sun, 5 May 2019 12:35:12 +0000 (12:35 +0000)
committerNicolas Lesser <blitzrakete@gmail.com>
Sun, 5 May 2019 12:35:12 +0000 (12:35 +0000)
commit0d07455a786444c22ac41e9a15f58ff2c994b1d3
treeb1d542a9420650605fa7a7aeda06606c4c85049b
parent3e0c2a51a0e7acafc37b86ce9838c6e1400054d5
[clang] fixing -ast-print for variadic parameter pack in lambda capture

Summary:
currently for:
```
 template<typename ... T>
void f(T... t) {
  auto l = [t...]{};
}
```
`clang -ast-print file.cpp`
outputs:

```
template <typename ...T> void f(T ...t) {
    auto l = [t]         {
        }
;
}
```
notice that there is not `...` in the capture list of the lambda. this patch fixes this issue. and add test for it.

Patch by Tyker

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61556

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359980 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/StmtPrinter.cpp
test/AST/ast-printer-lambda.cpp [new file with mode: 0644]