diff options
| author | Nicolas Lesser <blitzrakete@gmail.com> | 2018-07-12 18:45:41 +0000 |
|---|---|---|
| committer | Nicolas Lesser <blitzrakete@gmail.com> | 2018-07-12 18:45:41 +0000 |
| commit | b6d5c5871857f101cd88e99d115b310abf565bba (patch) | |
| tree | 940942ca50bf3e4306d422bb38664cc7f5a4d6e5 /clang/test | |
| parent | 9436570cbdee971868943c2214a71a25f90773c4 (diff) | |
| download | bcm5719-llvm-b6d5c5871857f101cd88e99d115b310abf565bba.tar.gz bcm5719-llvm-b6d5c5871857f101cd88e99d115b310abf565bba.zip | |
[C++17] Disallow lambdas in template parameters (PR33696).
Summary: This revision disallows lambdas in template parameters, as reported in PR33696.
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D37442
llvm-svn: 336930
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/CXX/expr/expr.prim/expr.prim.lambda/p2-template-parameter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p2-template-parameter.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p2-template-parameter.cpp new file mode 100644 index 00000000000..f120a63badc --- /dev/null +++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p2-template-parameter.cpp @@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -std=c++17 %s -verify + +template<auto> struct Nothing {}; + +void pr33696() { + Nothing<[]() { return 0; }()> nothing; // expected-error{{a lambda expression cannot appear in this context}} +} |

