diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Parse/Parser.cpp | 2 | ||||
-rw-r--r-- | clang/test/Parser/cxx0x-lambda-expressions.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index 7ccd2092a2d..c9243d64880 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -1948,7 +1948,7 @@ bool BalancedDelimiterTracker::diagnoseMissingClose() { // token. if (P.Tok.isNot(tok::r_paren) && P.Tok.isNot(tok::r_brace) && P.Tok.isNot(tok::r_square) && - P.SkipUntil(Close, FinalToken, + P.SkipUntil(Close, FinalToken, tok::cxx_defaultarg_end, Parser::StopAtSemi | Parser::StopBeforeMatch) && P.Tok.is(Close)) LClose = P.ConsumeAnyToken(); diff --git a/clang/test/Parser/cxx0x-lambda-expressions.cpp b/clang/test/Parser/cxx0x-lambda-expressions.cpp index e1be75686ad..6f69d8096e2 100644 --- a/clang/test/Parser/cxx0x-lambda-expressions.cpp +++ b/clang/test/Parser/cxx0x-lambda-expressions.cpp @@ -103,3 +103,8 @@ struct S { template <typename T> void m (T x =[0); // expected-error{{expected variable name or 'this' in lambda capture list}} } s; + +struct U { + template <typename T> + void m_fn1(T x = 0[0); // expected-error{{expected ']'}} expected-note{{to match this '['}} +} *U; |