diff options
-rw-r--r-- | clang/lib/Parse/ParseInit.cpp | 1 | ||||
-rw-r--r-- | clang/test/Parser/cxx0x-lambda-expressions.cpp | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseInit.cpp b/clang/lib/Parse/ParseInit.cpp index 7a455484b90..769140f2d3b 100644 --- a/clang/lib/Parse/ParseInit.cpp +++ b/clang/lib/Parse/ParseInit.cpp @@ -45,6 +45,7 @@ bool Parser::MayBeDesignationStart() { case tok::amp: case tok::kw_this: + case tok::star: case tok::identifier: // We have to do additional analysis, because these could be the // start of a constant expression or a lambda capture list. diff --git a/clang/test/Parser/cxx0x-lambda-expressions.cpp b/clang/test/Parser/cxx0x-lambda-expressions.cpp index b297d7356ca..2acd8144b7a 100644 --- a/clang/test/Parser/cxx0x-lambda-expressions.cpp +++ b/clang/test/Parser/cxx0x-lambda-expressions.cpp @@ -126,6 +126,19 @@ void PR22122() { template void PR22122<int>(); +namespace PR42778 { +struct A { + template <class F> A(F&&) {} +}; + +struct S { + void mf() { A{[*this]{}}; } +#if __cplusplus < 201703L + // expected-warning@-2 {{C++17 extension}} +#endif +}; +} + struct S { template <typename T> void m (T x =[0); // expected-error{{expected variable name or 'this' in lambda capture list}} |